Search⌘ K
AI Features

Example 5: Calculate the Dimensions of a Paper Given the Size

Explore how to apply control flow concepts in C programming by calculating the dimensions of A0 to A3 paper sizes. Learn the logic behind the size relationships and implement a program that prints each dimension, enhancing your understanding of decision structures and data manipulation.

Problem

The paper of size A0 has dimensions 1189 mm x 841 mm. Each subsequent size A(n) is defined as A(n-1) cut in half parallel to its shorter sides.

Write a program that takes A0 paper size as a parameter and print sizes of A0, A1, A2, and A3 on the console.

Example

Size of ...