int a=1,b=2,c=3;
printf("%d,%d",a,b,c);
What is the output?

Answers were Sorted based on User's Feedback



int a=1,b=2,c=3; printf("%d,%d",a,b,c); What is the output? ..

Answer / rahul

1,2

Is This Answer Correct ?    67 Yes 7 No

int a=1,b=2,c=3; printf("%d,%d",a,b,c); What is the output? ..

Answer / jaya prakash

1,2

because arguments of functions stored in stock
in stock stored as
"%d,%d"
a
b
c
in printf fn,
args popped out from stack
first "%d,%d" is popped
it find two int involved by %d in the control string
so two more args popped out
a,b
after popping the addr's then the values in that location
printed.(1,2)

Is This Answer Correct ?    28 Yes 3 No

int a=1,b=2,c=3; printf("%d,%d",a,b,c); What is the output? ..

Answer / peeyush mishra

output will be 1,2

Is This Answer Correct ?    24 Yes 3 No

int a=1,b=2,c=3; printf("%d,%d",a,b,c); What is the output? ..

Answer / sateeshbabu aluri

o/p will be: 1 2 only
3 will be ommited because there is no conversion operator
in printf.

Is This Answer Correct ?    13 Yes 0 No

int a=1,b=2,c=3; printf("%d,%d",a,b,c); What is the output? ..

Answer / madhu

No doubt ans is : 1,2

Is This Answer Correct ?    6 Yes 1 No

int a=1,b=2,c=3; printf("%d,%d",a,b,c); What is the output? ..

Answer / poornima

Actually, Stack follows Last In First Out(LIFO) style.No
doubt in tht.
In code, there is only two format specifier(ie., 2 %d) tht
will corresponds to first two variables.
Elements are pushed from right to left fashion in variable
declaration part.
In stack, c is bottom-most element & a is top-most element.
so,by code a is popped first then b.so, it will print 1,2.

Is This Answer Correct ?    8 Yes 4 No

int a=1,b=2,c=3; printf("%d,%d",a,b,c); What is the output? ..

Answer / priya

answer will be 1,2

Is This Answer Correct ?    5 Yes 1 No

int a=1,b=2,c=3; printf("%d,%d",a,b,c); What is the output? ..

Answer / arunkumar ms

1,2

Is This Answer Correct ?    6 Yes 2 No

int a=1,b=2,c=3; printf("%d,%d",a,b,c); What is the output? ..

Answer / amaresh chandra das

Ans:1,2

because arguments of functions stored in stack in FIFO order

So Var a enters 1st so it will out (popped)1st too as it's
STACK's property.

Is This Answer Correct ?    10 Yes 7 No

int a=1,b=2,c=3; printf("%d,%d",a,b,c); What is the output? ..

Answer / geetha

answer is 1,2

Is This Answer Correct ?    4 Yes 1 No

Post New Answer

More C Interview Questions

what is the stackpointer

2 Answers  


Can we change the value of constant variable in c?

0 Answers  


progrem to generate the following series 1 12 123 1234 12345

6 Answers   HCL, Wipro,


Write a program to swap two numbers without using third variable?

0 Answers  


Why do we use stdio h and conio h?

0 Answers  






What is the use of a ‘’ character?

0 Answers  


find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }

0 Answers   Microsoft,


what is use#in c

3 Answers  


What is the difference between char array and char pointer?

0 Answers  


why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above

0 Answers  


Give me basis knowledge of c , c++...

5 Answers  


What is the result main() { char c=-64; int i=-32 unsigned int u =-16; if(c>i){ printf("pass1,"); if(c<u) printf("pass2"); else printf("Fail2");} else printf("Fail1); if(i<u) printf("pass2"); else printf("Fail2") } a)Pass1,Pass2 b)Pass1,Fail2 c)Fail1,Pass2 d)Fail1,Fail2 e)none

9 Answers   IBM,


Categories