View Code of Problem 72

#include<stdio.h>
#include<math.h>
int main(){
	float m,n,x;
	float y;
	scanf("%f %f",&m,&n);
	y=m;
	int i;
	for(i=1;i<n+1;i++){
		x=m/2;
		y=y+2*x;
		m=m/2;
	}
	y=y-2*m;
	printf("%.2f %.2f",x,y);
}

Double click to view unformatted code.


Back to problem 72