View Code of Problem 72

#include <stdio.h>
#include <stdlib.h>

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

Double click to view unformatted code.


Back to problem 72