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

Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector

2 Answers  


what is the code of the output of print the 10 fibonacci number series

2 Answers  


String copy logic in one line.

11 Answers   Microsoft, NetApp,


What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++<n) p = &arr[i]; *p = 0; }

1 Answers  


why java is platform independent?

13 Answers   Wipro,






What is the output for the following program main() { int arr2D[3][3]; printf("%d\n", ((arr2D==* arr2D)&&(* arr2D == arr2D[0])) ); }

1 Answers  


main() { int i =0;j=0; if(i && j++) printf("%d..%d",i++,j); printf("%d..%d,i,j); }

1 Answers  


write a program to Insert in a sorted list

4 Answers   Microsoft,


How we print the table of 3 using for loop in c programing?

7 Answers  


#include<stdio.h> void fun(int); int main() { int a; a=3; fun(a); printf("\n"); return 0; } void fun(int i) { if(n>0) { fun(--n); printf("%d",n); fun(--n); } } the answer is 0 1 2 0..someone explain how the code is executed..?

1 Answers   Wipro,


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  


Is the following code legal? typedef struct a { int x; aType *b; }aType

1 Answers  


Categories