C++ User Input and Output
Cout:
You have already learned that cout is used that the output print value on the computer screen.
cout object used to the output value.
cout object together with insertion operator "<<"
cout simple "see-out"
Syntax:
court << "The user Output ";
Cin:
Cin get-User input data.
Cin is predefined variables that read data from the keyboard.
And use Extraction Operator ">>"
Cin simple "see-int"
Example
The user can input a number in which store they variable x.
Syntax:
cin >> Veriable_Name;
Program:
#include<iostream>
using namespace std;
main()
{
int x;
cout<<"Type a number "<<endl;
cin>>x;
cout<<"Your number is :"<<endl;
return 0;
}
Video:
C++ Tutorial 10 Slide
Free Learning Point
Post a Comment
Virtually nothing is impossible in this world if you just put your mind to it and maintain a
positive attitude.