View Code of Problem 72

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

Double click to view unformatted code.


Back to problem 72