Sunday 1 November 2015

write a program to print fibonacci series using loop in c language.

write a program to find factorial of given number in c language. #include<stdio.h> #include<conio.h> Void main( ) ... thumbnail 1 summary

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