View Code of Problem 72

    #include <stdio.h>
    #include <math.h>
    int main()
    {
		float a,x,y;
    	int b,i;
		scanf("%f %d",&a,&b);
		y=a;

        for(i=1;i<b;i++)
		{
			a=a/2;
			y=y+2*a;
		}
        a=a/2;
		printf("%.2f %.2f\n",a,y);
    }

Double click to view unformatted code.


Back to problem 72