Fibonacii series

C program to find number is Armstrong or not  :

code

  #include<stdio.h>

#include<conio.h>

   void main()

{

      int  a=0,b=1,c,term;

     clrscr();

     printf(“\nEnter the number of terms :”);

     scanf(“%d”, &term);

     printf(“\nFirst %d terms of fibonacii series :”);

     printf(“%d \n %d”,a,b);

    for(i=0;i<term-2;i++)

 {

    c=a+b;

    printf(“\n%d”,c);

    a=b;

    b=c;

}

 getch();

}


output

Enter the number of terms :

5

First 5 terms of fibonacii series :

0

1

1

2

3

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s