View Code of Problem 71

#include<stdio.h>
int main(){
	double n,sum=0,a=2,b=1;
	scanf("%lf",&n);
	while(n--){
		sum+=a/b;
		a+=b;
		b=a-b;
	}
	printf("%0.2lf",sum);
	return 0;
}

Double click to view unformatted code.


Back to problem 71