main()

{

int i;

printf("%d",scanf("%d",&i)); // value 10 is given as
input here

}

Answers were Sorted based on User's Feedback



main() { int i; printf("%d",scanf("%d",&i)); // ..

Answer / susie

Answer :

1

Explanation:

Scanf returns number of items successfully read and not 1/0.
Here 10 is given as input which should have been scanned
successfully. So number of items read is 1.

Is This Answer Correct ?    24 Yes 1 No

main() { int i; printf("%d",scanf("%d",&i)); // ..

Answer / keerthi

1

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More C Code Interview Questions

main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }

29 Answers   IBM, TCS, UGC NET, Wipro,


main() { printf("%x",-1<<4); }

3 Answers   HCL, Sokrati, Zoho,


Write a program using one dimensional array to assign values and then display it on the screen. Use the formula a[i]=i*10 to assign value to an element.

1 Answers   Samar State University,


how can i search an element in an array

2 Answers   CTS, Microsoft, ViPrak,


main() { unsigned int i=65000; while(i++!=0); printf("%d",i); }

1 Answers  






How we will connect multiple client ? (without using fork,thread)

3 Answers   TelDNA,


int i; main(){ int t; for ( t=4;scanf("%d",&i)-t;printf("%d\n",i)) printf("%d--",t--); } // If the inputs are 0,1,2,3 find the o/p

2 Answers  


main() { char s[ ]="man"; int i; for(i=0;s[ i ];i++) printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]); }

1 Answers   DCE,


#define a 10 void foo() { #undef a #define a 50 } int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } explain the answer

1 Answers  


main() { int i, j, *p; i = 25; j = 100; p = &i; // Address of i is assigned to pointer p printf("%f", i/(*p) ); // i is divided by pointer p } a. Runtime error. b. 1.00000 c. Compile error d. 0.00000

3 Answers   HCL,


source code for delete data in array for c

1 Answers   TCS,


main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above

2 Answers   HCL,


Categories