Test yourself on everything in the course: printing, variables, arithmetic, decisions and loops.

  1. 1. What does std::cout << "A" << std::endl << "B"; print?

  2. 2. Which lines declare a whole number variable count that starts at 0?

  3. 3. What is the value of 2 + 3 * 4?

  4. 4. What is the value of 10 % 4?

  5. 5. What does std::cout << 10 / 4.0; print?

  6. 6. With x equal to 15, which conditions are true?

  7. 7. What happens to the cases below a matching case that has no break?

  8. 8. Which type stores a single character such as 'y'?

  9. 9. What does for (int i = 1; i <= 4; ++i) { if (i == 2) { continue; } std::cout << i; } print?

  10. 10. What does int n = 4; int total{}; while (n > 0) { total += n; --n; } std::cout << total; print?

  11. 11. What does const int limit{10}; limit = 20; do?

  12. 12. What does std::cout << (5 == 5); print?