sim = 1 + 3/2 + 5/3 + 8/5 + 13/8 + 21/13
+ 34/21 + 55/34 + 89/55 + 144/89 + 233/144
+ 377/233 + 610/377 + 987/610 + 1597/987 + 2584/1597
+ 4181/2584 + 6765/4181 + 10946/6765 + 17711/10946 + 28657/17711
= 33.2783
Press any key to continue
#include<iostream>
using namespace std;
void main() {
int x, x1 = 2, x2 = 3;
double s = 1;
cout<<" sim = 1";
for(int i = 1; i <= 20; i++) {
cout<<" + "<<x2<<'/'<<x1;
s += double (x2) / x1;
x = x1;
x1 = x2;
x2 += x;
if(!(i%5)) cout<<endl;
}
cout<<" = "<<s<<endl;
}