diff --git a/CODE in C/Numbers/Fibonacci.c b/CODE in C/Numbers/Fibonacci.c new file mode 100644 index 0000000..711522b --- /dev/null +++ b/CODE in C/Numbers/Fibonacci.c @@ -0,0 +1,16 @@ +#include +int main() { + int i, n, t1 = 0, t2 = 1, nextTerm; + printf("Enter the number of terms: "); + scanf("%d", &n); + printf("Fibonacci Series: "); + + for (i = 1; i <= n; ++i) { + printf("%d, ", t1); + nextTerm = t1 + t2; + t1 = t2; + t2 = nextTerm; + } + + return 0; +} \ No newline at end of file