#include<stdio.h>
int main()
{
float sum=0.0;
int i=0;
float a=1.0;
float b=2.0;
float t=0.0;
for(i=0;i<20;i++)
{
sum=sum+b/a;
t=a+b;
a=b;
b=t;
}
printf("%10.4f\n",sum);
return 0;
}
#include<stdio.h>
int main()
{
float sum=0.0;
int i=0;
float a=1.0;
float b=2.0;
float t=0.0;
for(i=0;i<20;i++)
{
sum=sum+b/a;
t=a+b;
a=b;
b=t;
}
printf("%10.4f\n",sum);
return 0;
}