What is the output of the following C++ program? #include <iostream> using…
What is the output of the following C++ program?
#include <iostream>
using namespace std;
int x = 10;
void fun() {
int x = 2;
{
int x = 1;
cout << ::x << endl;
}
}
int main() {
fun();
return 0;
}- A.
1
- B.
2
- C.
10
- D.
error
Attempted by 271 students.
Sign up free to check your answer
Sign up freeLoading lesson…

