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 ios diff. Between %e & %f?

3 Answers   Honeywell,


how to add two numbers without using arithmetic operators?

4 Answers  


WHAT IS PRE POSSESSORS?

6 Answers   TATA,


How can I copy just a portion of a string?

0 Answers  


Explain what is wrong with this program statement? Void = 10;

0 Answers  






Can we access the array using a pointer in c language?

0 Answers  


int i =10 main() { int i =20,n; for(n=0;n<=i;) { int i=10 i++; } printf("%d", i);

6 Answers   HCL, Octal, SW,


i want to know aptitude questions,technical questions

2 Answers  


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

0 Answers  


Which of the following are valid "include" formats? A)#include and #include[file.h] B)#include (file.h) and #include C)#include [file.h] and #include "file.h" D)#include <file.h> and #include "file.h"

15 Answers   Accenture,


Is main is user defined function?

0 Answers  


How to convert decimal to binary in C using recursion??

4 Answers   HP, IBM,


Categories