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

Is it possible to type a name in command line without ant quotes?

1 Answers   Excel, Infosys,


What is the hidden bug with the following statement? assert(val++ != 0);

1 Answers  


#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

2 Answers  


How will u find whether a linked list has a loop or not?

8 Answers   Microsoft,


main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 b. 2, 100 c. 4, 100 d. 4, 4

18 Answers   HCL, IBM, Infosys, LG Soft, Satyam,


print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!

11 Answers   Wipro,


Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.

2 Answers  


what will be the output of this program? void main() { int a[]={5,10,15}; int i=0,num; num=a[++i] + ++i +(++i); printf("%d",num); }

3 Answers   Wipro,


main() { int a[10]; printf("%d",*a+1-*a+3); }

1 Answers  


Give a one-line C expression to test whether a number is a power of 2.

10 Answers   Microsoft,


Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.

2 Answers   Wipro,


plz send me all data structure related programs

2 Answers  


Categories