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 / vishnu
first calculations will be done from right to left and then
prints accroding to the parameters passed.
| Is This Answer Correct ? | 29 Yes | 8 No |
Post New Answer View All Answers
What is an lvalue in c?
Why does everyone say not to use gets?
What is the use of sizeof?
Do you know what are the properties of union in c?
Is register a keyword in c?
Explain the use of function toupper() with and example code?
what is different between auto and local static? why should we use local static?
When should you not use a type cast?
How does sizeof know array size?
How many levels deep can include files be nested?
What does do in c?
Can two or more operators such as and be combined in a single line of program code?
In a switch statement, explain what will happen if a break statement is omitted?
What is a floating point in c?
how to count no of words,characters,lines in a paragraph.