how to use cin in cpp code example
Example 1: cin in c++
cin >> varName;
Example 2: cin statement c++
#include <iostream>
using namespace std;
int main() {
string nameEntered;
cout << "Enter your name: \n";
cin >> nameEntered;
cout << "So, your name is " << nameEntered;
return 0;
}
Example 3: cin syntax in c++
cin >> var1 >> var2 >> … >> varN;