Vidyalelo
C++ Programming · Q92

Pointers and References in C++

Programming · C++ Programming · question 92

Q92

What will be the output of the following C++ code? #include using namespace std; int &fun() int x = 10; return x; int main() fun() = 30; cout << fun(); return 0;

A.
30
B.
10
C.
Error
D.
Segmentation fault
Answer

Answer: Option D

Solution

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