Skip to content
KALANBLON
Show contents

Chapter 4 of 4 · 10 min

Quiz: your first steps in C++

Compiling, std::cout, variables and types: let's check that the basics of C++ are in place. You need 70% correct answers.

Quiz

6 questions · pass mark: 70%

  1. 1.What does this program display?

    One answer

    #include <iostream>
    
    int main() {
        std::cout << 9 / 2 << "\n";
    }
  2. 2.Which command compiles game.cpp into an executable called game, with warnings?

    One answer

  3. 3.Which declarations are correct? (several answers)

    Several answers possible

  4. 4.Fill in the keyword that prevents any change to the variable.

    Complete the code

    ____ double PI = 3.14159;
  5. 5.What does std::cout << 20.0 / 4 << "\n"; display?

    One answer

  6. 6.The compiler displays 40 lines of errors. What do you do first?

    One answer

Your progress is saved on this device. Create a free account to keep your progress on all your devices.