what is the output of the below program & why ?
#include<stdio.h>
void main()
{
int a=10,b=20,c=30;
printf("%d",scanf("%d%d%d",&a,&b,&c));
}

Answers were Sorted based on User's Feedback



what is the output of the below program & why ? #include<stdio.h> void main() { int a=..

Answer / gaurav sharma

because printf returns the number of printed arguments .here
3 arguments taken ,the concept is ( scanf also return the
number of arguments so 3 returned to printf .m gaurav
sharma ,,,,,works in aricent.

Is This Answer Correct ?    8 Yes 0 No

what is the output of the below program & why ? #include<stdio.h> void main() { int a=..

Answer / vibekananda dash

dear selvam,

its showing o/p,
its ask for entry and it accept ur entry,
o/p is -
i entered
1
press enter 2
press enter 78
press enter 3.


my question is why its showing 3.

Is This Answer Correct ?    4 Yes 0 No

what is the output of the below program & why ? #include<stdio.h> void main() { int a=..

Answer / kalyani

The answer is 3 because scanf returns no of arguments

Is This Answer Correct ?    5 Yes 1 No

what is the output of the below program & why ? #include<stdio.h> void main() { int a=..

Answer / arun

BUT IT IS SHOWIING -1 ANSWER IN GCC COMPLIER

Is This Answer Correct ?    2 Yes 1 No

what is the output of the below program & why ? #include<stdio.h> void main() { int a=..

Answer / arka bandyopadhyay

for Gcc compiler the code is producing error infact DevC++ just crashed . But using ANSI turbo C++ Ans is 3 ,
As the number of parameters in the printf() function is 3

Is This Answer Correct ?    1 Yes 0 No

what is the output of the below program & why ? #include<stdio.h> void main() { int a=..

Answer / selvam

this program contain no error and it will not give any output...

Is This Answer Correct ?    4 Yes 5 No

Post New Answer

More C Code Interview Questions

how to swap 3 nos without using temporary variable

4 Answers   Satyam,


void main() { int x,y=2,z; z=(z*=2)+(x=y=z); printf("%d",z); }

4 Answers  


Write a procedure to implement highlight as a blinking operation

2 Answers  


create a C-code that will display the total fare of a passenger of a taxi if the driver press enter,the timer will stop. Every 10 counts is 2 pesos. Initial value is 25.00

0 Answers   Microsoft,


All the combinations of prime numbers whose sum gives 32

1 Answers   HHH,






main() { printf("%d", out); } int out=100;

3 Answers  


main() { if ((1||0) && (0||1)) { printf("OK I am done."); } else { printf("OK I am gone."); } } a. OK I am done b. OK I am gone c. compile error d. none of the above

5 Answers   HCL,


#define DIM( array, type) sizeof(array)/sizeof(type) main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr, int)); }

1 Answers  


Cluster head selection in Wireless Sensor Network using C programming language.

0 Answers  


4. Main() { Int i=3,j=2,c=0,m; m=i&&j||c&I; printf(“%d%d%d%d”,I,j,c,m); }

2 Answers   Broadridge,


main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); }

3 Answers  


main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }

2 Answers   Adobe, CSC,


Categories