View Code of Problem 72

#include<stdio.h>
int main()
{
	int i,n;
	double m,h=0;
	scanf("%lf %d",&m,&n);
	for(i=1;i<=n;i++)
	{
	     h=h+m+m/2;
	     m=m/2;
	}
	h=h-m;
	printf("%.2f %.2f\n",m,h);
	return 0 ;
}

Double click to view unformatted code.


Back to problem 72