Embercode
✕
C++ Variables and Data TypesQuick quiz

Two's complement and big numbers

7 questions. Covers Big integers.

Questions 1 to 5 of 7

  1. 1. What does C++ say happens when a signed integer such as int overflows?
  2. 2. What does this program print? ``cpp #include <cstdint> #include <iostream> int main() { std::uint8_t b = 200; b = static_cast<std::uint8_t>(b + 100); std::cout << static_cast<int>(b) << '\n'; } ``
  3. 3. What is the name of the scheme for negative numbers in which the top bit of an 8-bit value stands for -128?

    Type your answer.

  4. 4. On the lesson's 64-bit program, which value is printed for 21! as a std::uint64_t?
  5. 5. Roughly how much work does the multiply function in the lesson do for two digit containers with n and m digits?

5 question(s) left on this page.

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