Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
int main ()
4.
{
5.
int x, y;
6.
x = 5;
7.
y = ++x * ++x;
8.
cout
Options:
A .  749736
B .  736749
C .  367497
D .  none of the mentioned
Answer: Option A

Because of the precedence the pre-increment and post increment operator, we got the output 

as 749736.
Output:
$ g++ op.cpp
$ a.out
749736



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers