Loading...
Loading...
Loading Curriculum...
Loading Subject...
Loading Topic...
Loading Lesson...
Loading Lab...
C++ uses stream objects for I/O operations. The iostream header provides cin and cout as the primary channels for reading input and displaying output.
coutSends data to the console screen
operator <<cinReads data from the keyboard
operator >>cerrOutputs unbuffered error messages
operator <<clogOutputs buffered log messages
operator <<cout << "Hello, World!" << endl;
int x = 42; cout << "Value: " << x << endl;
int age; cin >> age;
int a, b; cin >> a >> b;
Both create a newline, but endl also flushes the buffer. In competitive programming, use \n for faster output.