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
How can I handle floating-point exceptions gracefully?
How can you access memory located at a certain address?
Why calloc is better than malloc?
Is this program statement valid? INT = 10.50;
Explain union. What are its advantages?
I have a varargs function which accepts a float parameter?
What are the types of bitwise operator?
Explain what is page thrashing?
What is pass by reference in c?
Write a program for finding factorial of a number.
What is a good data structure to use for storing lines of text?
What is the usage of the pointer in c?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
What are the basic data types associated with c?
List some of the static data structures in C?