Solved

What Is the Output of the Following Program?
#Include \quad

Question 20

Multiple Choice

What is the output of the following program?
#include <iostream>
using namespace std;
void doSomething(int) ;
int main()
{
\quad int x = 2;
\quad cout << x << endl;
\quad doSomething(x) ;
\quad cout << x << endl;
\quad return 0;
}
void doSomething(int num)
{
\quad num = 0;
\quad cout << num << endl;
}


A) 2
0
2
B) 2
2
2
C) 0
0
0
D) 2
0
0

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions