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 access command-line arguments?

4 Answers  


# include<stdio.h> aaa() { printf("hi"); } bbb(){ printf("hello"); } ccc(){ printf("bye"); } main() { int (*ptr[3])(); ptr[0]=aaa; ptr[1]=bbb; ptr[2]=ccc; ptr[2](); }

1 Answers  


How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)

4 Answers   HCL,


main() { int i=5,j=10; i=i&=j&&10; printf("%d %d",i,j); }

1 Answers  


#include <stdio.h> #define a 10 main() { #define a 50 printf("%d",a); }

2 Answers  






What are segment and offset addresses?

2 Answers   Infosys,


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  


#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d----%d",*p,*q); }

1 Answers  


main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }

1 Answers  


main() { int i; clrscr(); printf("%d", &i)+1; scanf("%d", i)-1; } a. Runtime error. b. Runtime error. Access violation. c. Compile error. Illegal syntax d. None of the above

1 Answers   HCL,


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,


Who could write how to find a prime number in dynamic array?

1 Answers  


Categories