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;
}
Discussion:
71 comments Page 7 of 8.
Jyoti said:
7 years ago
As I compiled, I am getting 3 as an output.
Priyanka said:
6 years ago
The answer is 3 because post-increment.
(1)
Krishanu said:
1 decade ago
Please run that code the out will be 3.
Prashant said:
9 years ago
According to me the answer is 3.
Divyam Singh Negi said:
3 years ago
I think the correct answer is 3.
(10)
Amolak said:
1 decade ago
@Siraj.
Output will be : 3, 4.
Output will be : 3, 4.
Aarti Sonawane said:
8 months ago
Good explanation, thanks all.
Divya Reddy said:
5 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)
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers