will the program compile? int i; scanf(“%d”,i); printf(“%d”,i);
Answers were Sorted based on User's Feedback
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 |
Answer / girish
it gives the garbage value of that perticular element.
Is This Answer Correct ? | 4 Yes | 1 No |
What is Memory leakage ?
What are the different types of data structures in c?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
#include<stdio.h> int SumElement(int *,int); void main(void) { int x[10]; int i=10; for(;i;) { i--; *(x+i)=i; } printf("%d",SumElement(x,10)); } int SumElement(int array[],int size) { int i=0; float sum=0; for(;i<size;i++) sum+=array[i]; return sum; } output?
1 232 34543 4567654 can anyone tell me how to slove this c question
Is multithreading possible in c?
Is return a keyword in c?
What is the purpose of the code, and is there any problem with it? unsigned int f( unsigned n ) { return –n & 7; }
Is c easier than java?
What are c header files?
What is typedef example?
What is the difference between printf and scanf in c?