C++ Program using Input Operator

This program uses >> input operator to input numbers a,b and c. And then displays the output using << output operators. The input operator is also called as get operator.

#include<iostream>
using namespace std;
int main(){
	int a,b,c;
	cout<<"Enter three numbers : ";
	cin>>a>>b>>c;
	cout<<"The numbers are"<<endl;
	cout<<"a : "<<a<<endl;
	cout<<"b : "<<b<<endl;
	cout<<"c : "<<c<<endl;
	return 0;
}

The image shows the output of the program

output of the above program. Enter three numbers. program using input operator
output of the above program. Enter three numbers

You can enter three numbers. Then the program displays those three numbers.

output of the above program. program using input operator
output of the above program.

Leave a Reply