Embercode
✕
Character Arrays and StringsQuick quiz

Formatting

6 questions. Covers Formatting output.

Questions 1 to 5 of 6

  1. 1. What does this line print? ``cpp #include <format> #include <iostream> int main() { std::cout << std::format("[{:^7}]\n", "ab"); } ``
  2. 2. What does this line print? ``cpp #include <format> #include <iostream> int main() { std::cout << std::format("{:08.3f}\n", -3.14159); } ``
  3. 3. What is the lesson's term for the number of digits that come after the decimal point in a {:.2f} rule?

    Type your answer.

  4. 4. Which iostream manipulator sets the padding character? Write its name without std::.

    Type your answer.

  5. 5. What does this line print? ``cpp std::cout << std::format("{}\n", 1, 2); ``

5 question(s) left on this page.

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