#include <stdio.h>

int main() {
    int n = 10, i = 2, fib1 = 0, fib2 = 1, nextTerm;

    printf("Fibonacci Series: %d, %d, ", fib1, fib2);

    do {
        nextTerm = fib1 + fib2;
        printf("%d, ", nextTerm);
        fib1 = fib2;
        fib2 = nextTerm;
        i++;
    } while (i < n);

    return 0;
}

Embed on website

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