Skip to main content

Exercises 4.3 Programming Exercise

1.

Enter the program in Listing 4.2.2 and get it to work. What is \(17 \times 2^{14}\text{?}\) What is \(17 / 2^{3}\text{?}\) Explain the results.

Hint

\(1 << n = 2^{n}\)

Answer

Shifting \(17\) to the left \(14\) times gives \(278528\text{.}\) Shifting \(17\) to the right \(3\) times gives \(2\text{.}\)