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

Number box

int · about 12 minutes

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

How it works.

int stores an integer. To the left is the name, to the right is the meaning.

int points = 5;

✦ The variable name in cout is written without quotation marks.

STEP 2

Try to understand.

The variable name in cout is written without quotation marks.

int stars = 3;
cout << stars << 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() {
    int stars = 3;
    cout << stars << endl;
    return 0;
}
Open the editor for class work
HOMEWORK

Solve it yourself

Create int score with a value of 7 and output score.

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

Opening up your homework