View Code of Problem 72

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

Double click to view unformatted code.


Back to problem 72