Skip to content

Instantly share code, notes, and snippets.

@bquast
Last active Jul 3, 2019
Embed
What would you like to do?
Fibonacci printing C program (while x < 255). Compile using: gcc fib.c -o fib
#include <stdio.h>
int main(void) {
int x, y, z;
while (1) {
x = 0;
y = 1;
do {
printf("%d\n", x);
z = x + y;
x = y;
y = z;
} while (x < 255);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment