Solved

What Will the Following Code Display?
#Include ≪iostream>
Using Namespace \quad

Question 3

Multiple Choice

What will the following code display?
#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;
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

Related Questions