cout <<
Writes to the output stream.
Syntax
cout << value;
Description
You write values to the output with the << operator (you can chain them). endl or "\n" adds a new line. Requires <iostream>.
Example
Loading editor…
Expected output
Hello World 7
When to use?
Showing results, debugging.
Common mistakes
- ⚠️ << direction matters: cout << value (stream to left).