Search This Blog

Loading...

Write a C program to generate fibbonacci series of numbers (total 20 numbers) i.e. 1, 1, 2, 3, 5, 8….etc : GTU Nov-Dec 2010

#include<stdio.h>
#include<conio.h>

void main()
{
    int i, a=1, b=0, sum;
    clrscr();

    for(i=0;i<20;i++)
    {
        sum = a + b;
        a = b;
        b = sum;
        printf("%d", sum);     
    }
 
    getch();
}

No comments:

Post a Comment