View Code of Problem 72

#include<stdio.h>
#include<math.h>
#include<string.h>
void main()
{
	float m,n,h,t;
	scanf("%f%f",&m,&n);
	t=m;
	printf("%.2f ",m/pow(2,n));
	for(int i=0;i<=n-2;i++)
		t+=m/pow(2,i);
	printf("%.2f",t);
}

Double click to view unformatted code.


Back to problem 72