#include <stdio.h>
int main() {
    int n, first = 0, second = 1, x, i;

    printf("Enter the number of terms: ");
    scanf("%d", &n);

    printf("Fibonacci Series: ");

    for (i = 0; i < n; i++) {
        if (i <= 1)
            x = i;
        else {
            x = first + second;
            first = second;
            second = x;
        }
        printf("%d ", x);
    }

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: