Syntax and Output
cout prints with the << operator. endl (or "\n") ends the line. Statements end with a semicolon. // starts a comment and /* ... */ spans lines.
Example
cout << "Hello" << endl;
cout << "Number: " << 42 << "\n";
// a comment
cout << 3 + 4 << endl;Result
Hello Number: 42 7
Exercise
Which operator sends values to cout?
cout "Hi";
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.