- 3
Write a program that shows the following series?need help please??
1 1 2 2 4 7 11
6 Antworten
+ 2
Gohar Zubair Khan got my point from above comment?
+ 2
It resembles Fibonacci sequence.
+ 2
#include <iostream>
using namespace std;
int main()
{
int previous = 0;
int num = 1;
while(num < 12)
{
cout << num << " ";
int temp = num;
num += previous;
previous = temp;
}
return 0;
}
//output: 1 1 2 3 5 8
//umm. This is a little different.
+ 2
ok it is very easy...it is Fibonacci series with some subtraction trick
fibo : 1 1 2 || 3 5 8 || 13 21 34 ||55
sub : 0 0 0 || 1 1 1 || 2 2 2 || 3
new: 1 1 2 || 2 4 7 || 11 19 32 || 52
sub mean substraction.
+ 1
hey Gohar Zubair Khan could you please write more expansion of the series here?
is it like below,
1 1 2 2 4 7 11 19 32 52
0
The Great Saga it's till 11. ..