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

Which node is more powerful and can handle local information processing or graphics processing?

0 Answers  


write a programe to find the factorial of given number using recursion

3 Answers  


What is spaghetti programming?

0 Answers  


6)swap(int x,y) { int temp; temp=x; x=y; y=temp; } main() { int x=2;y=3; swap(x,y); } after calling swap ,what are yhe values x&y?

3 Answers  


program to print upper & lower triangle of a matrix

2 Answers   TCS,


Is it acceptable to declare/define a variable in a c header?

0 Answers  


Explain the use of keyword 'register' with respect to variables.

0 Answers  


Why is void main used?

0 Answers  


How do I use strcmp?

0 Answers  


Program to write some contents into a file using file operations with proper error messages.

2 Answers  


How to find a missed value, if you want to store 100 values in a 99 sized array?

0 Answers   Honeywell, Zomato,


How can I avoid the abort, retry, fail messages?

0 Answers  


Categories