Receiving Input using cin in c++




This video tutorial explains how to use cin in c++ to read the input from the user through keyboard.
You will learn what is cin, how to use cin to read input from user, how to use extraction operator with cin, how to receive input for multiple variables using one cin in detail with examples.

source code for this tutorial

#include <iostream>

using namespace std;

int main()
{
int age;
float avg;

cout << "Enter your age and average" << endl;
cin >> age >> avg;
cout << "you have entered " << age << endl << "average " << avg;
return 0;
}

 
Back To Top