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
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 |
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 |
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 |
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 |
print ur name 20,000 times without using inbuilt library functions like printf,scanf,gets,puts,getchar or putchar
compare array with pointer?
Design a program using an array that lists even numbers and odd numbers separately from the 12 numbers supplied by a user.
How does selection sort work in c?
If fflush wont work, what can I use to flush input?
What is the mean of function?
Explain bit masking in c?
for(i=1;i>0;i++); printf("i=%d",i); what will be the answer????
What are the advantages of Macro over function?
how can i sort numbers from ascending order and descending order using turbo c..
Print all numbers which has a certain digit in a certain position eg: number=45687 1 number=4 2 number=5 etc
what is difference between ++(*p) and (*p)++
17 Answers Accenture, HCL, IBM,