View Code of Problem 72

#include<stdio.h>
main()
{
    int i, M, N;
    scanf("%d%d", &M, &N);
    float sum = M, a = sum / 2;
    for(i = 2; i <= N; i++)
    {
        sum += a * 2;
        a = a / 2;
    }
    printf("%.2f %.2f\n", a, sum);
    return 0;
}

Double click to view unformatted code.


Back to problem 72