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

TECH-TUTORIALS

Post Top Ad

demo-image

C LANGUAGE TUTORIAL-(1)-FIBONACCI SERIES

Share This
Responsive Ads Here
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:-
IMG_20190102_233348
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:-

IMG_20190102_233618



Program code with Python language:



IMG_20190102_234333



.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:-

IMG_20190102_234243+%25281%2529









Comment Using!!

12 comments:

  1. blogger_logo_round_35
  2. blogger_logo_round_35
  3. tectuner
  4. blank

    This comment has been removed by a blog administrator.

    ReplyDelete
  5. blogger_logo_round_35

    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
  6. blogger_logo_round_35

    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
  7. blogger_logo_round_35

    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
  8. blogger_logo_round_35

    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
  9. blank
  10. blank

    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
  11. blank

    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
  12. blank

    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

Pages