View Code of Problem 72

#include<stdio.h>
int main(){
	int n;
	float m;
	float sum=0.0;
	
	scanf("%f%d",&m,&n);
	
	for(int i=1;i<=n;i++){
		sum=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