View Code of Problem 71

#include<stdio.h>
int main(){

    float a=2,b=1,sum=0;
    int i,n,temp;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        sum+=a/b;
        temp =a;
        a=temp+b;
        b=temp;
    }
    printf("%.2f",sum);
    return 0;
}

Double click to view unformatted code.


Back to problem 71