What will be the output of the following C++ code?

#include<iostream>
using namespace std;
int main ()
{
   int cin;
   cin >> cin;
   cout << "cin: " << cin;
   return 0;
}

a) Segmentation fault
b) Nothing is printed
c) Error
d) cin: garbage value

1 thought on “What will be the output of the following C++ code?”

Leave a Comment