Sail E0 Webinar
Question


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
Options:
A .  532
B .  235
C .  235
D .  311
Answer: Option D

In this program, We are preincrementing and postincrementing the operands and saving it.
Output:
$ g++ incre5.cpp
$ a.out
311



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers