Fibonacci

Run Settings
LanguageC
Language Version
Run Command
#include <stdio.h> int fib(int n){ int a = 1; int b = 0; int c = 0; for(int i = 0; i < n; i++){ c = b + a; a = b; b = c; } return c; } int main(void) { for(int i = 1; i < 11; i++){ int num = fib(i); printf("n %d = %d\n", i, num); } return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines