View Code of Problem 72

#include<stdio.h>
int main()
{

    int  M,N,i;
    scanf("%d%d",&M,&N);
    double h=M,sum=M;
    for(i=0;i<N-1;i++){
            h=h/2;
         sum=sum+h*2;

    }
    printf("%.2f ",h/2);
    printf("%.2f",sum);
}

Double click to view unformatted code.


Back to problem 72