will the program compile? int i; scanf(“%d”,i); printf(“%d”,i);

Answers were Sorted based on User's Feedback



will the program compile? int i; scanf(“%d”,i); printf(“%d”,i);..

Answer / vignesh1988i

surely it will compile and run , no problem will be in
it.... but the problem lies in ur scanf statement , there
what ever u have typed as an input number , that number
wont be stored in 'i' since you have left ur '&'(reference
operator) , so ur compiler dosen't know where to store ur
input value....... so it will print some garbage value in
the printf().........


thank u

Is This Answer Correct ?    17 Yes 0 No

will the program compile? int i; scanf(“%d”,i); printf(“%d”,i);..

Answer / girish

it gives the garbage value of that perticular element.

Is This Answer Correct ?    4 Yes 1 No

will the program compile? int i; scanf(“%d”,i); printf(“%d”,i);..

Answer / raghav

it showing the null pointer assignment

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

What are the advantages of c preprocessor?

0 Answers  


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

0 Answers  


What is calloc in c?

0 Answers  


please tell me the logic for this C program : INPUT (string):ABCD OUTPUT :BCDA CDAB DABC

2 Answers   Mphasis,


Why is it usually a bad idea to use gets()? Suggest a workaround.

1 Answers  






What is Heap?

3 Answers  


What is operator promotion?

0 Answers  


Explain how can I avoid the abort, retry, fail messages?

0 Answers  


explain about storage of union elements.

2 Answers   ABC, Bosch,


simple program for virtual function?

1 Answers  


what is the value of 'i'? i=strlen("Blue")+strlen("People")/strlen("Red")-strlen("green")

7 Answers   Cadence, JNTU, Zen Technologies,


What is wrong with this program statement? void = 10;

0 Answers  


Categories