View Code of Problem 48

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

Double click to view unformatted code.


Back to problem 48