Cookie policy · You can change your choice at any time on the page „Cookies“.

Accessibility

Text size
Read aloud

Your browser reads the text with the voice it has for this language.

Accessibility statement

Quiz

Computer science I: Variables and assignment statements

10 computer science questions for year 1, following the national curriculum: arithmetic operations and expressions, constants and variables, the = operator, variable types (int, double).

Choose the right answer for each question. When you finish, click Check answers and read the explanations.

1. What is a variable?

2. What is x after: int x = 5; x = x + 3;

3. Which C++ variable type is for whole numbers?

4. What is 7 / 2 in C++ if both are int?

5. What is 7 % 3 in C++?

6. What does the = sign mean in C++?

7. What is a after: int a = 2, b = 3; a = b; b = 10;

8. What is 2 + 3 * 4 in C++?

9. What is a constant?

10. What does this show: double p = 2.5; cout << p * 4;