Write a C program to print the Fibonacci series

Using DO -WHILE Loop

#include<stdio.h>
main(){
    int i = 0, j = 1, temp, cnt = 0;
    printf("0 1 ");
    do {
        cnt++;
        temp = i + j;
        i = j;
        j = temp;
        printf("%d ", j);

    } while (cnt <8);

}

Post a Comment

1 Comments

  1. This comment has been removed by a blog administrator.

    ReplyDelete