Translate

Labels

Showing posts with label FIBONACCI SERIES. Show all posts
Showing posts with label FIBONACCI SERIES. Show all posts

Friday, 21 June 2013

FIBONACCI SERIES USING ARRAYS

#include<stdio.h>
#include<conio.h>
main()
{
int a[30];
int x,n;
clrscr();
printf("Enter no.of times to print:");
scanf("%d",&n);
printf("\n FIBONACCI SERIES :");

Friday, 28 December 2012

FIBONACCI SERIES

#include<stdio.h>
#include<conio.h>
void main()
{
int i, n;
int a=-1;
int b=1;
int c=0;
clrscr();
printf("Enter the number of terms to generate fibonacci series:");
scanf("%d",&n);
for(i=0;i<n;i++)
{
c=a+b;
a=b;
b=c;
printf("%d\n",c);
}
getch();
}