Fibonacci Series in C || for loop || C programming
In this, we are going to see for loop, the program is based on for loop which basically, prints the Fibonacci Series of numbers i.e. 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144...... with the help of the C Programming language. 
 


#include <stdio.h>
int main()
{
    long int a, b, c, i, n;
    b = 0;
    c = 1;
    printf("Enter a number:-\n");
    scanf("%ld", &n);

    for (i = 1; i <= n; i++)
    {
        printf("%ld\n", b);
        a = b + c;
        b = c;
        c = a;
    }

    return 0;
}

//......Coded by YASH ALAPURIA

#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post