Question
1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int num1 = 5;
6.
int num2 = 3;
7.
int num3 = 2;
8.
num1 = num2++;
9.
num2 = --num3;
10.
cout
What is the output of this program?
1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int num1 = 5;
6.
int num2 = 3;
7.
int num3 = 2;
8.
num1 = num2++;
9.
num2 = --num3;
10.
cout
Answer: Option D
Was this answer helpful ?
In this program, We are preincrementing and postincrementing the operands and saving it.
Output:
$ g++ incre5.cpp
$ a.out
311
Was this answer helpful ?
More Questions on This Topic :
Question 6.
Pick out the correct statement.
....
Submit Solution