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

{ int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }

4 Answers  


can u give me the c codings for converting a string into the hexa decimal form......

1 Answers  


main() { extern i; printf("%d\n",i); { int i=20; printf("%d\n",i); } }

1 Answers  


main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }

1 Answers  


int aaa() {printf(“Hi”);} int bbb(){printf(“hello”);} iny ccc(){printf(“bye”);} main() { int ( * ptr[3]) (); ptr[0] = aaa; ptr[1] = bbb; ptr[2] =ccc; ptr[2](); }

1 Answers  






Write a program to model an exploding firecracker in the xy plane using a particle system

0 Answers   HCL,


Write a program that find and print how many odd numbers in a binary tree

1 Answers  


main() { float f=5,g=10; enum{i=10,j=20,k=50}; printf("%d\n",++k); printf("%f\n",f<<2); printf("%lf\n",f%g); printf("%lf\n",fmod(f,g)); }

1 Answers  


What is the output for the program given below typedef enum errorType{warning, error, exception,}error; main() { error g1; g1=1; printf("%d",g1); }

1 Answers  


main() { static char names[5][20]={"pascal","ada","cobol","fortran","perl"}; int i; char *t; t=names[3]; names[3]=names[4]; names[4]=t; for (i=0;i<=4;i++) printf("%s",names[i]); }

2 Answers  


main() { int i; i = abc(); printf("%d",i); } abc() { _AX = 1000; }

2 Answers  


main() { int i=400,j=300; printf("%d..%d"); }

3 Answers  


Categories