View Code of Problem 71

#include<stdio.h>
int main()
{
  int i,k;
  double t, a=0.0,b=1.0,c=2.0;
  scanf("%d",&k);
  for(i=0;i<k;i++){
    a+=c/b;
    t=b;
    b=c;
    c=t+c;
   }
  printf("%.2f",a);
  return 0;
}
    

Double click to view unformatted code.


Back to problem 71