From 254ea92f2d19026e4c99ae00ac8a1f8280deb992 Mon Sep 17 00:00:00 2001 From: lelefolkl Date: Thu, 21 Oct 2021 21:04:13 -0300 Subject: [PATCH] lelefolkl --- C/program-86/README.md | 3 +++ C/program-86/fibonacci.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 C/program-86/README.md create mode 100644 C/program-86/fibonacci.c diff --git a/C/program-86/README.md b/C/program-86/README.md new file mode 100644 index 0000000..1eaf01a --- /dev/null +++ b/C/program-86/README.md @@ -0,0 +1,3 @@ +program 86 + +C program to create and list of N fibonacci terms \ No newline at end of file diff --git a/C/program-86/fibonacci.c b/C/program-86/fibonacci.c new file mode 100644 index 0000000..a291947 --- /dev/null +++ b/C/program-86/fibonacci.c @@ -0,0 +1,28 @@ +#include +#include +#include +#include + +main() { + + + + int a, b, aux, i, n; + + a = 0; + b = 1; + + printf("type a number: "); + scanf("%d", &n); + printf("\nFibonacci:\n"); + printf("%d\n", b); + + for(i = 0; i < n; i++) { + + aux = a + b; + a = b; + b = aux; + + printf("%d\n", aux); + } +}