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: Input and C++ specifics

10 computer science questions for year 1, following the national curriculum: input statement (cin), prompts for the user, char type, formatted output.

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

1. Which C++ statement reads a value from the keyboard?

2. Why do we put a cout message before cin?

3. The user types 6. What is shown: int n; cin >> n; cout << n * n;

4. Which C++ type stores a single character?

5. The user types 4 and 5. What is shown: int a, b; cin >> a >> b; cout << a + b;

6. Which header do we include for cin and cout?

7. What does setprecision(2) with fixed do when printing 3.14159?

8. The user types 10. What is shown: double c; cin >> c; cout << c / 4;

9. What does this show: char z = 'M'; cout << z << z;

10. A rectangle area program: what is the right order?