Embercode
✕
Character Arrays and StringsQuick quiz

Counting and cipher

7 questions. Covers Caesar cipher.

Questions 1 to 5 of 7

  1. 1. What does this code print? ``cpp std::cout << caesar("Zebra", 1) << '\n'; ``
  2. 2. With count_letters from the lesson, which only counts lowercase letters, what does this print? ``cpp Counts counts = count_letters("Hello World"); std::cout << counts['l' - 'a'] << ' ' << counts['h' - 'a'] << ' ' << counts['w' - 'a']; ``
  3. 3. In count_letters, which index does the letter q use in the 26-slot array? Type the number.

    Type your answer.

  4. 4. Which C++ cast turns the number 'a' + i back into a letter that prints as a character? Type the cast name without the arguments.

    Type your answer.

  5. 5. What does -3 % 26 evaluate to in C++?

5 question(s) left on this page.

Typed answers ignore extra spaces and, for most questions, capital letters.