View Code of Problem 72

#include<stdio.h>
#include<math.h>
main()
{
	int N;
	float M,sum;
	scanf("%f %d",&M,&N);
	sum=0;
	while(N>0){
		sum=sum+M+M/2;
		M=M/2;
		N--;
	}
	printf("%.2f %.2f",M,sum-M);
}

Double click to view unformatted code.


Back to problem 72