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
Answer: d Explanation: cin is a variable hence overrides the cin object. cin >> cin has no meaning so no error.