C++ · ОСНОВЫ · LESSON 01

First message

cout and main · about 12 minutes

Learning with progressRead the summary for free. To save the work, log in to the account.
STEP 1

How it works.

main is the door to the program. cout shows the text. The text is enclosed in double quote marks.

cout << "Привет!" << endl;
Pathway
CodecoutScreenПривет!

✦ endl translates the cursor to a new line.

STEP 2

Try to understand.

endl translates the cursor to a new line.

cout << "Доброе утро!" << endl;

✦ Compare this to the first one. Then do the cool job yourself.

IN-CLASS PRACTICE

Type the code yourself

Manually type the program from the sample. So you'll remember commands and brackets.

#include <iostream>
using namespace std;

int main() {
    cout << "Доброе утро!" << endl;
    return 0;
}
Open the editor for class work
HOMEWORK

Solve it yourself

Output «Привет, C++!» through cout and endl.

The answer is hidden. Use similar examples from the lesson notes.

Opening up your homework