Question: how cin works in c++?
Answer: Standard input (cin) In most program environments, the standard input by default is the keyboard, and the C++ stream object defined to access it is cin . int age; cin >> age; The first statement declares a variable of type int called age , and the second extracts from cin a value to be stored in it.