View Code of Problem 72

#include "stdio.h"

void main()
{
	int i;
	double sum;
	double high;
	int	count;
	scanf("%lf%d",&high,&count);
	sum=high;
	for(i=0;i<count-1;i++)
	{
		high=high/2;
		sum=sum+high*2;
	}
	printf("%.2lf %.2lf",high/2,sum);
}

Double click to view unformatted code.


Back to problem 72