...

/

Discussion: You See It Everywhere

Discussion: You See It Everywhere

Execute the code to understand the output and gain insights into sequence generation.

Run the code

Now, it's time to execute the code and observe the output.

Press + to interact
#include <stdio.h>
int main()
{
int f, n;
int count;
f = n = 1;
count=0;
while( count < 20 ) {
printf("%d ", f);
f+=n;
printf("%d ", n);
n+=f;
count+=2;
}
putchar('\n');
return(0);
}

Understanding the output

The code outputs the first 20 values of the Fibonacci sequence:

1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765
Code output
...