Follow Our FB Page << >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...



int i;


printf("%d", &i)+1;

scanf("%d", i)-1;


a. Runtime error.

b. Runtime error. Access violation.

c. Compile error. Illegal syntax

d. None of the above

main() { int i; clrscr(); printf("%d", &i)+1; scanf("%d",..

Answer / guest

d, printf( ) prints address/garbage of i,

scanf() dont hav & sign, so scans address for i

+1, -1 dont hav any effect on code

Is This Answer Correct ?    13 Yes 3 No

Post New Answer

More C Code Interview Questions

Find the largest number in a binary tree

7 Answers   Infosys,

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

1 Answers   HCL, rsystems,

#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225 c. 15 d. none of the above

3 Answers   HCL,

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  

To reverse an entire text file into another text file.... get d file names in cmd line

0 Answers   Subex,

/*what is the output for*/ void main() { int r; printf("Naveen"); r=printf(); getch(); }

4 Answers  

#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }

4 Answers   Google, HCL, Quick Heal, WTF,

#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

1 Answers  

void main() { int const * p=5; printf("%d",++(*p)); }

3 Answers   Infosys, Made Easy, State Bank Of India SBI,

main() { void swap(); int x=10,y=8; swap(&x,&y); printf("x=%d y=%d",x,y); } void swap(int *a, int *b) { *a ^= *b, *b ^= *a, *a ^= *b; }

2 Answers  

void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }

1 Answers  

how to return a multiple value from a function?

2 Answers   Wipro,