bsc

Comprehensive codebase and coursework for the 4-year B.Sc. Computer Science Honours degree (WBSU)

git clone https://github.com/notamitgamer/bsc.git
· rebuilt hourlyOpen on GitHub
root / semester_1 / letusc / luc003.c

luc003.c (695B)


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