View Code of Problem 72

#include<stdio.h>
#include<string.h>
main()
{
	 int m,n,i;
	 float s=0,k;
	 scanf("%d %d",&m,&n);
	s=k=m;
	k=k/2;
	for(i=2;i<=n;i++)
	{
		s=s+2*k;
		k=k/2;
	}
	printf("%.2f %.2f",k,s);
}

Double click to view unformatted code.


Back to problem 72