C++ COURSE
C++ User Input
Learn C++ programming with EDUHUB Code Hub.
C++ User Input
The cin object is used to get input from users.
#include <iostream>
using namespace std;
int main(){
string name;
cout << "Enter name: ";
cin >> name;
cout << name;
return 0;
}
Explanation
cin takes information from the keyboard.