C LANGUAGE TUTORIAL-(1)-FIBONACCI SERIES - TECH-TUTORIALS

TECH-TUTORIALS

Post Top Ad

Responsive Ads Here

C LANGUAGE TUTORIAL-(1)-FIBONACCI SERIES

Share This
FIBONACCI SERIES

Fibonacci series is a set of numbers that starts with one or zero(both correct)followed by one, in which each successive element in the sequence is adding by two previous element in the sequence.this sequence is named after the italian mathematicain "fibonacci" .so in the fibonacci series the  1st element  is 0 and 2nd element is 1 so the 3rd element will be 1 now for next element will be the sum of the previous two element that area 1 and 1 ,so the 4th element will be 2,so by applying  this logic we are getting the fibonacci series as:-                       0 1 1 2 3 5  8 13 21 34....

Formula:-

    Fn=Fn-1+Fn-2

Flowchart:-

                 FLOWCHART








































PROGRAM CODE:-



  Program code with c language:-
code-1




Code:-

#include<stdio.h>
#include<conio.h>
int main()
{
int n,i,a=-1,b=1,c;
printf("enter the no of terms you want display");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
c=a+b;
a=b;
b=c;
printf("%5d",c);
}
}




output screen:-




Program code with Python language:






.CODE:-

n=int(input("enter the no of terms you want to display "))

a=-1

b=1

for i in range(1,n+1):

    c=a+b
    a=b
    b=c
    print(c,end="    ")

OUTPUT SCREEN:-










12 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. Pleasant to peruse this distribution on this blog. To the extent I can see, this is an exceptionally essential question for everybody in reality. Its my own conclusion and I am totally concurred with the subject utilized here

    ReplyDelete
  3. creativity of writer is purely impressive. It has touched to the level of expertise with his writing. Everything is up to the mark. Written perfectly and I can use such information for my coming assignment. how to cancel tinder gold

    ReplyDelete
  4. i discovered new platform through this weblog and were given to recognize who i am capable of address burden of lot many essay writing projects. Now i am feeling charge after segregation of my paintings over unique writers over internet. how to cancel tinder gold

    ReplyDelete
  5. If you're juicing for health, or doing a juice fast, you MUST use organic produce. Pesticides and heavy metals in the soil used to grow normal fruit and vegetables will negate any cleansing you're trying to accomplish, wasting your money and time.satta king play bazaar
    play bazaar satta king

    ReplyDelete
  6. Thank you so much for this insightful post. Take part in the content of this article . It can be weirdly pleasurable to click repeatedly.

    ReplyDelete
  7. Thank you so much for this insightful post. Take part in the content of this article spacebar clicker games . It can be weirdly pleasurable to click repeatedly.

    ReplyDelete
  8. I appreciate you sharing your expertise in such an understandable and direct manner. This was a really useful article. straight to this particular profile Mental Age Test. These assessments can be enlightening and provide information on how our brains are developing.

    ReplyDelete

Post Bottom Ad

Responsive Ads Here

Pages