f) Paper of size AO 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. Thus paper of size A1 would have dimensions 841
mm x 594 mm. Write a program to calculate and print paper size
A0, A1, A2, ... AS.
Answers
Answer:
sorry bro
Explanation:
Paper of size A0 has dimensions 1189mm*841mm. Each subsequent size A(n) is defined as A(n-1) cut in half parallel to its shorter sides. write a programm to calculate and print paper sizes A0,A1,A2...A8 I am not able to write a programme in c for this. how to write it?
below is the c program
#include <stdio.h>
int main()
{
int Length=1189,Width=841, x, y;
for (x = 0; x <= 8; x++)
{
printf("A%d -> %d x %d\n", x, Length, Width);
y = Length;
Length = Width;
Width = y / 2;
}
return 0;
}
Answer:
//Paper size
#include <stdio.h>
int main()
{
int A0, A1, A2, A3, A4, A5, A6, A7, A8, h = 1189, w = 841, h2, h4, h8, h16, w2, w4, w8, w16;
char character = 'x';
h2 = h/2;
h4 = h/4;
h8 = h/8;
h16 = h/16;
w2 = w/2;
w4 = w/4;
w8 = w/8;
w16 = w/16;
printf("A0 = %d%c%d\n", h, character, w);
printf("A1 = %d%c%d\n", w, character, h/2);
printf("A2 = %d%c%d\n", h/2, character, w/2);
printf("A3 = %d%c%d\n", w/2, character, h/4);
printf("A4 = %d%c%d\n", h/4, character, w/4);
printf("A5 = %d%c%d\n", w/4, character, h/8);
printf("A6 = %d%c%d\n", h/8, character, w/8);
printf("A7 = %d%c%d\n", w/8, character, h/16);
printf("A8 = %d%c%d\n", h/16, character, w/16);
return 0;
}
OUPPUT;
A0 = 1189x841
A1 = 841x594
A2 = 594x420
A3 = 420x297
A4 = 297x210
A5 = 210x148
A6 = 148x105
A7 = 105x74
A8 = 74x52
SOLUTION USING BASIC CONCEPTS