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) cin: garbage value
b) Error
c) Segmentation fault
d) Nothing is printed

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

Leave a Comment