Write a c program to print Fibonacci series using for loop

Write a c program to print Fibonacci series using for loop. This is the basic set of the program in C programming language.This fibonacci number series program in any language this is the basic and next step to the mathematical program in any programming language.

#include <stdio.h>int main() {int i, n, t1 = 0, t2 = 1, next;printf("Enter the number");scanf("%d", &n);printf("Fibonacci Series");for (i = 1; i <= n; ++i){printf("%d, ", t1);next = t1 + t2;t1 = t2;t2 = next;}return 0;}

Output

Enter the number 6 Fibonacci Series0, 1, 1, 2, 3, 5,