void main()
{
int a=1;
printf("%d %d %d",a,++a,a++);
}
the output is supposed to be 1 2 2....but it is 3 3 1
this is due to calling conventions of C. if anyone can
explain me how it happens?
Answer Posted / keerthi
while printing the output it starts from right hand
side ..so first 'a++' value is printed then '++a' value and
last it prints 'a' value
| Is This Answer Correct ? | 12 Yes | 16 No |
Post New Answer View All Answers
praagnovation
how to capitalise first letter of each word in a given string?
Combinations of fibanocci prime series
What are the 5 elements of structure?
Explain what are compound statements?
Is c is a procedural language?
How can I write a function analogous to scanf?
Linked lists -- can you tell me how to check whether a linked list is circular?
In C programming, how do you insert quote characters (‘ and “) into the output screen?
Explain high-order and low-order bytes.
Write a program to swap two numbers without using the third variable?
How main function is called in c?
How do you list a file’s date and time?
What is a nested formula?
How do you determine whether to use a stream function or a low-level function?