What is the output of the following program?
#include <iostream>
using namespace std;
void doSomething(int) ;
int main()
{
int x = 2;
cout << x << endl;
doSomething(x) ;
cout << x << endl;
return 0;
}
void doSomething(int num)
{
num = 0;
cout << num << endl;
}
A) 2
0
2
B) 2
2
2
C) 0
0
0
D) 2
0
0
Correct Answer:
Verified
Q14: Which of the following statements about global
Q16: These types of arguments are passed to
Q17: A parameter is a special purpose variable
Q18: This is a collection of statements that
Q21: A local variable and a global variable
Q22: What is the output of the
Q23: Look at the following function prototype.
Q23: The value in a(n) _ variable persists
Q24: Look at the following function prototype. int
Q25: This statement causes a function to end.
A)
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents