View Code of Problem 72

#include<stdio.h>
int main()
{
	float M,N; 
	scanf("%f %f",&M,&N); 
	float S=M,K=M;
	for(int i=1;i<N;i++)
	{
		M=M/2;
		S+=M; 
	}
	printf("%.2f %.2f",M/2,2*S-K);
	return 0;
} 

Double click to view unformatted code.


Back to problem 72