program to construct Fibonacci series

Fibonacci series 

Hello friends looking for making a program with special kind of series, there are many applications of the series in the field go computer science and matches.
You have been studying many types of series in moths; it is also one of them.
In this series the starting points are same which are actually fixed,
And then the series start in a manner like the next term is a sum of previous two terms.


There are different methods to perform the operation but c4fun brings you the simplest and shortest method to make the series so, are you ready.
First let’s talk about the logic here is the logic behind has bed understood, so now  when you have the logic now you need the alga which would the program would be following while performing the execution.
So you also need to understand that and follow the same steps.

Some terms are fixed and next terms are being taken out so what is required, you have to think of them,

What steps should be there to change the sum of the series so that new term can be printed without disturbing the previous terms.
Yes when you have the alga in your mind you would be able to make the code
Build the code if you are struck in the middle don’t worry c4fun also gives you the source code which can be used to make this program.
Use it and find out the mistake in your code you were thinking of.

 for constructing the Fibonacci series using a loop .
 c4fun bring the code,written  below you can print  term of the series 
 this sequence is  known as Fibonacci numbers. 


numbers of the series are 0, 1, 1, 2, 3, 5, 8, ...,. 
Except,the first two terms of the sequence, every other term is the sum of the previous two number, 
for example, 5 = 2 + 3 (addition of 2 and 3).


#include<stdio.h>
#include<conio.h>
void main()
{
int n,a=-1,b=1,c,i;
clrscr();
printf("\n enter the number of terms");
scanf("%d",&n);
for(i=1;i<=n;i++)
{c=a+b;
printf("%d\t",c);
a=b;
b=c;
}
getch();
}


sequence,has many  different applications in  the field of Mathematics & Computer Science.
any number of terms with any numers of sequence can be printed 
use differnet value of  input to obtained differnet reults.comment down the different type of output you obtained when you use the diffenet values of inputs



Done coding, now it’s time yes you are right it’s time for sharing and commenting,
When you have gone through the steps were they confusing?
Were it was able to give or delivered the message they contains?
Were they able to solve the problem you were facing?


Do share the blog among your friends and thus help them \to build a code for which they are looking, as remember sharing is caring and c4fun believes in shading and caring
So share different programs among your friends and grow and help grow others..


If you have any doubt or query or any problem, comment down the question if comment section and it would be resolve as soon as possible.
Keep coding ….and keep yourself updated which is the most important thing required in the field of coding, as things keep changing every moment.
Keep sharing…..
Keep learning….






No comments

thanks for reading and sharing.I hope it would help you!!!!

Powered by Blogger.