Hello. Today I am working on a project in which I have to make a program that can solve and print the first twenty numbers of a fibonacci sequence.
I do not want the code for a finished program, just some commands and such that can help me finish.
TL;DR: I need some commands to solve an equation.
int main()
{
int original = 0;
int next = 1;
int final = 0;
int amount = 20;
cout << original << ", ";
cout << next << ", ";
for (int i = 0; i < amount; i++)
{
final = original + next;
cout << final << ", ";
original = next;
next = final;
}
getchar();
return 0;
}