main()

{

int (*functable[2])(char *format, ...) ={printf, scanf};

int i = 100;

(*functable[0])("%d", i);

(*functable[1])("%d", i);

(*functable[1])("%d", i);

(*functable[0])("%d", &i);

}

a. 100, Runtime error.

b. 100, Random number, Random number, Random number.

c. Compile error

d. 100, Random number



main() { int (*functable[2])(char *format, ...) ={printf, scanf}; int i = 100; ..

Answer / vishnu kant gupta

a is correct.

because it should be -

(*functable[0])("%d", i);

(*functable[1])("%d", &i);

(*functable[1])("%d", &i);

(*functable[0])("%d", i);

Is This Answer Correct ?    29 Yes 6 No

Post New Answer

More C Code Interview Questions

There is a lucky draw held every day. if there is a winning number eg 1876,then all possible numbers like 1867,1687,1768 etc are the numbers that match irrespective of the position of the digit. Thus all these numbers qualify fr the lucky draw prize Assume there is no zero digit in any numbers. write a program to show all the possible winning numbers if a "winning number"is passed as an arguments to the function.

1 Answers   Nagarro,


#include<stdio.h> #include<conio.h> void main() { int a=(1,2,3,(1,2,3,4); switch(a) { printf("ans:"); case 1: printf("1");break; case 2: printf("2");break; case 3: printf("1");break; case 4: printf("4");break; printf("end"); } getch(); }

0 Answers  


Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net.

0 Answers  


What is full form of PEPSI

0 Answers  


int a = 10 + 10 .... ,... A = A * A What would be the value of A? The answer is 120!! Could anyone explain this to me.

2 Answers   Bosch, eInfochips, HCL, IHCL,






main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcpy(a,b)); } a. “Hello” b. “Hello World” c. “HelloWorld” d. None of the above

4 Answers   Corporate Society, HCL,


There were 10 records stored in “somefile.dat” but the following program printed 11 names. What went wrong? void main() { struct student { char name[30], rollno[6]; }stud; FILE *fp = fopen(“somefile.dat”,”r”); while(!feof(fp)) { fread(&stud, sizeof(stud), 1 , fp); puts(stud.name); } }

1 Answers  


void main() { int *mptr, *cptr; mptr = (int*)malloc(sizeof(int)); printf(“%d”,*mptr); int *cptr = (int*)calloc(sizeof(int),1); printf(“%d”,*cptr); }

1 Answers  


plz send me all data structure related programs

2 Answers  


main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }

2 Answers  


Write a program to receive an integer and find its octal equivalent?

7 Answers  


WAP to display 1,2,3,4,5........N

2 Answers  


Categories