15 June 2012

A program in c to generate Fibonacci series


#include<stdio.h>

#include<conio.h>

void main()

{

int a =0,b=1,c,i=2,n;

clrscr();

printf("Enter N Value : ");

scanf("%d",&n);

printf("%d\t%d\t",a,b);

while(n>i)

{

c = a+b;

printf("%d\t",c);

c=b;

b=a;

i++;

}

getch();

}


1 comments:

Engineering has been one of the most exciting fields to enter for several decades now. Perhaps more than any other industry, field or time in history, during this time in computer hardware engineering there has been more advancement and evolution than ever before or anywhere else. Read more for more details.

Post a Comment