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

#define prod(a,b) a*b main() { int x=3,y=4; printf("%d",prod(x+2,y-1)); }

1 Answers  


Write a program to model an exploding firecracker in the xy plane using a particle system

0 Answers   HCL,


code of a program in c language that ask a number and print its decremented and incremented number.. sample output: input number : 3 321123

1 Answers   HCL,


int a=1; printf("%d %d %d",a++,a++,a); need o/p in 'c' and what explanation too

1 Answers  


create a C-code that will display the total fare of a passenger of a taxi if the driver press enter,the timer will stop. Every 10 counts is 2 pesos. Initial value is 25.00

0 Answers   Microsoft,






main() { printf("\nab"); printf("\bsi"); printf("\rha"); }

3 Answers  


What are the following notations of defining functions known as? i. int abc(int a,float b) { /* some code */ } ii. int abc(a,b) int a; float b; { /* some code*/ }

1 Answers  


what is the output of the below program & why ? #include<stdio.h> void main() { int a=10,b=20,c=30; printf("%d",scanf("%d%d%d",&a,&b,&c)); }

6 Answers   CSC, IIIT,


#include <stdio.h> #define a 10 main() { #define a 50 printf("%d",a); }

2 Answers  


write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?

1 Answers  


main() { int i = 100; clrscr(); printf("%d", sizeof(sizeof(i))); } a. 2 b. 100 c. 4 d. none of the above

5 Answers   HCL,


#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); }

2 Answers  


Categories