C Programming - Expressions - Discussion

Discussion Forum : Expressions - Find Output of Program (Q.No. 9)
9.
What will be the output of the program?
#include<stdio.h>
int main()
{
    int i=3;
    i = i++;
    printf("%d\n", i);
    return 0;
}
3
4
5
6
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
71 comments Page 8 of 8.

Subhajyoti said:   2 decades ago
i is initialised a value 3,which is again assigned to i as the post decrement operator will be executed after completion of the statement.after completion of the statement i value increases to 4 which will be the output.


Post your comments here:

Your comments will be displayed after verification.