View Code of Problem 72

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

Double click to view unformatted code.


Back to problem 72