View Code of Problem 72

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

Double click to view unformatted code.


Back to problem 72