View Code of Problem 72

#include<stdio.h>
int main(){
	double n,s;
	scanf("%lf %lf",&s,&n);
	double sum=s;
	n--;
	while(n--){
		s/=2;
		sum+=2*s;
	}
	s/=2;
	printf("%0.2f ",s);
	printf("%0.2f",sum);
}

Double click to view unformatted code.


Back to problem 72