View Code of Problem 71

#include<stdio.h>
int main()
{
    double n=2,m=1,N,t,sum=0.00;
   scanf("%Lf",&N);
 
    while(N)
    {
      sum=sum+n/m;
 
      t=m;
      m=n;
      n=n+t;
     N--;
    }	
	
	printf("%.2f\n",sum);
	
	return 0;
}

Double click to view unformatted code.


Back to problem 71