View Code of Problem 48

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

Double click to view unformatted code.


Back to problem 48