0% found this document useful (0 votes)
136 views1 page

Cin Cout

cin and cout are objects used for input and output in C++. cin is an object of the istream class that reads input from the user, typically using the extraction operator >>. cout is an object of the ostream class that performs output to the screen, typically using the insertion operator <<. Both are part of the iostream library that provides convenient input and output operations in C++ programs.

Uploaded by

Piron Live
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
136 views1 page

Cin Cout

cin and cout are objects used for input and output in C++. cin is an object of the istream class that reads input from the user, typically using the extraction operator >>. cout is an object of the ostream class that performs output to the screen, typically using the insertion operator <<. Both are part of the iostream library that provides convenient input and output operations in C++ programs.

Uploaded by

Piron Live
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CIN / COUT in C++

In C++, cin and cout are objects that are used for handling input and output
operations, respectively.

• cin is an object of the istream class, which is used to read input from the
user. It accepts input from a standard input device, such as a keyboard, and
is linked to stdin, the regular C input source. It is typically used with the
extraction operator >>.
• cout is an object of the ostream class, which is used to perform output
operations. It is used to display the output to the screen, i.e., the standard
output device stdout. It is typically used with the insertion operator <<.

These are part of the C++ Standard Library, specifically the iostream library,
which stands for input/output stream. It provides a convenient unformatted way to
perform input and output operations in C++.

#include <iostream>
using namespace std;

int x;

int main(void)
{
cin >> x;
cout << x * x << endl;
cout << "End of the program" << endl;
return 0;
}

You might also like