Q. What will be the output of the following C++ code?
Code:
#include<iostream>
using namespace std;
int main ()
{
int cin;
cin >> cin;
cout << "cin: " << cin;
return 0;
}
-
(A)
Nothing is printed
-
(B)
Segmentation fault
-
(C)
cin: garbage value
-
(D)
Error
✅ Correct Answer: (C)
cin: garbage value