write a program to find factorial of given number in c language.
#include<stdio.h>
#include<conio.h>
Void main( )
{
Int
n,first=0,second=1,next,c;
Printf(“enter
the number of terms\n”);
Scanf(“%d”,&n);
Printf(“first
%d terms of Fibonacci series are :\n”,n);
For(c=0;c<n;c++)
{
If(c<=1)
{
Next=c;
}
Else
{
Next=first+second;
First=second;
Second=next;
}
Printf(“%d\n”,next);
}
}
No comments
Post a Comment