...

/

Solution Review: Paper Sizes

Solution Review: Paper Sizes

Follow the step-by-step instructions to find paper sizes.

We'll cover the following...

Solution

RUN the code given below!

Press + to interact
#include <stdio.h>
void papersizes ( int, int, int, int ) ;
int main( )
{
papersizes ( 0, 7, 1189, 841 ) ;
}
void papersizes ( int i, int n, int l, int b )
{
int newl, newb ;
if ( n != 0 )
{
printf ( "A%d:L = %d B = %d\n", i, l, b ) ;
newb = l / 2 ;
newl = b ;
n-- ;
i++ ;
papersizes ( i, n, newl, newb ) ;
}
}

In each call to ...