luc003.c (832B)
1 /* 2 * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 3 * Repo: https://github.com/notamitgamer/bsc 4 * License: MIT 5 */ 6 7 /* Paper of size AO has dimensions 1189 mm x 841 mm. 8 Each subsequent size A(n) is defined as A(n-1) cut in 9 half, parallel to its shorter sides. Thus, paper of 10 size A1 would have dimensions 841 mm x 594 mm. Write 11 a program to calculate and print paper sizes A0,� 12 A1,�A2,�...�A8. */ 13 /* Let Us C; Page - 19; Chap- 1; QNo.: F(c) */ 14 15 #include<stdio.h> 16 #include<math.h> 17 int main() { 18 double s_long = 1189.0, s_short = 841.0, temp; 19 int i; 20 printf("A0 Dimension : %g mm x %g mm", floor(s_long), floor(s_short)); 21 for (i = 1; i <= 8; i++) { 22 temp = s_long; 23 s_long = s_short; 24 s_short = temp / 2; 25 printf("\nA%d Dimension : %g mm x %g mm", i, floor(s_long), floor(s_short)); 26 } 27 return 0; 28 }