View Code of Problem 72

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

Double click to view unformatted code.


Back to problem 72