View Code of Problem 72

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

Double click to view unformatted code.


Back to problem 72