View Code of Problem 71

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


}
/*
Main.c: In function 'main':
Main.c:15:9: error: expected ';' before '}' token
         }
         ^
*/

Double click to view unformatted code.


Back to problem 71