Question
1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int x = 5, y = 5, z;
6.
x = ++x; y = --y;
7.
z = x + ++x;
8.
cout
What is the output of this program?
1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int x = 5, y = 5, z;
6.
x = ++x; y = --y;
7.
z = x + ++x;
8.
cout
Answer: Option D
Was this answer helpful ?
In this program, we are adding the x value after preincrementing two times.
Output:
$ g++ incre4.cpp
$ a.out
14
Was this answer helpful ?
More Questions on This Topic :
Question 5.
Pick out the correct statement.
....
Submit Solution