View Code of Problem 72

#include<stdio.h>
int main()
{
double m,n,h,sum=0;
  scanf("%lf %lf",&m,&n);
  int i=0;
  for(i=0;i<n;i++)
  { sum=sum+h;
    h=m/2;
    sum=sum+h;
  }
  printf("%.2lf %.2lf\n",h,sum+m);
}

Double click to view unformatted code.


Back to problem 72