main()
{
int i=5;
printf("%d%d%d%d",i++,i--,i);
}
Answer Posted / sravankumar
printf() function evaluates from right to left
printf("\n %d %d %d",i++,i--,i);
4 5 5
<- <- <- <- <-evaluation of expression
but prints as the way we mentioned in printf() function
i.e first i = 5
then i--= 5 because it is post decrement
then i++= 4 this because i is decremented in above, and
not incremented immediately because is post
increment
So output is : 4 5 5
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
What is #define size in c?
What is c variable?
How do I read the arrow keys? What about function keys?
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
how to introdu5ce my self in serco
What does s c mean on snapchat?
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
What is the use of typedef in c?
Can true be a variable name in c?
Explain what is the difference between the expression '++a' and 'a++'?
How would you rename a function in C?
How can I discover how many arguments a function was actually called with?
What is a 'null pointer assignment' error?
Can we change the value of #define in c?
What is the general form of a C program?