Vidyalelo
C++ Programming · Q38

Functions and Procedures in C++

Programming · C++ Programming · question 38

Q38

What is the output of the following code: int x = 5; cout << "Before: " << x; changeValue(x); cout << "After: " << x; in C++?

A.
Before: 5 After: 5
Answer
B.
Before: 5 After: 10
C.
Before: 5 After: 6
D.
Compilation error

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board