Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given code below need correct output. Help ME ASAP FAST Question code file So need this answer main.c 1 #include 2 3 4 int f1(

Given code below need correct output. Help ME ASAP FAST

Question code file

image text in transcribed

image text in transcribed

So need this answer

image text in transcribed

main.c 1 #include 2 3 4 int f1( char var ) 5-{ 6 char fn[]="[f1]"; 7 int return_val=1; HNM in N000 printf("%s: input is: %c and returns %2d ", fn, var, return_val ); 10 11 return return_val; 12 } 13 14 int f2( char var ) 15- { 16 char fn[]="[f2]"; 17 int return_val=2; 18 19 printf("%s: input is: %c and returns %2d ", fn, var, return_val ); 20 21 return return_val; 22 } 23 24 int f3( char var ) 25- { 26 char fn[]="[13]"; 27 int return_val=3; 28 29 printf("%s: input is: %c and returns %2d ", fn, var, return_val ); 30 31 return return_val; 32 } 33 mmmm , int main() { 1: Declare an ARRAY of 3 chars initialized to contain 3 chars 'b' and 'C' name the array "carray" ("c" is for char). char carray[4] {'a', 'b', 'c', '10'}; // 1: REPLACE the print statement below with array declaration printf("1: TODO: Add declaration of -- an array of 3 chars --- : "); 2: Declare ARRAY of function pointers below - where each function : takes one 'char' input argument and returns an 'int' as reference the below function declaration: void (*ptr_func)(int); where: *ptr_func is a ptr to a function that returns 'void' with one 'int' argument You -- need to think on how the array is initialized // // 2: add declaration below: printf("2: TODO: Add declaration of -- an array of function ptrs--- : "); 3: // call each of the functions by iterating through // the array declared in 2, with input from // from carray (iterating through the array declared // in 1). i.e: // first iteration f1 with input carray item @ second iteration f2 with input carray item 1 // third iteration f3 with input carray item 2 // insert the call inside the while Loop below. int c = 0; while( c

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students also viewed these Databases questions

Question

=+free to pirate employees from competitors?

Answered: 1 week ago