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:
70 comments Page 7 of 7.

Krishanu said:   1 decade ago
Please run that code the out will be 3.

Priyanka said:   5 years ago
The answer is 3 because post-increment.
(1)

Prashant said:   9 years ago
According to me the answer is 3.

Divyam Singh Negi said:   2 years ago
I think the correct answer is 3.
(9)

Amolak said:   1 decade ago
@Siraj.

Output will be : 3, 4.

Aarti Sonawane said:   1 month ago
Good explanation, thanks all.

Divya Reddy said:   4 years ago
Yes, agree the answer is 3.
(2)

Gudimalla said:   7 years ago
According to me, it is 3.

Dhananjay Khairnar said:   4 years ago
3 is the Right Answer.
(3)

Mandy said:   1 decade ago
Thank Abiyot.


Post your comments here:

Your comments will be displayed after verification.