Generate the Fibonacci Series

#include<stdio.h>

void main()
{
int t,i,m=0,n=1,f=1;
printf("\n\nEnter the number of terms:");
scanf("%d",&t);
printf("\n The Fibonacci Series of %d terms:\n",t);
for(i=1;i<=t;i++)
{
printf("%d\t",f);
f=m+n;
m=n;
n=f;
}
}


  

Comments

Popular posts from this blog

Write a Program to Add two 3x3 Matrix using C

C program for Unit Conversion

Write a Program to Add two 5x5 Matrix using C