answersLogoWhite

0

Program to Print Fibonacci Series

#include
#include
void main()
{
int n,i,f1=0,f2=1,f3;
clrscr();
printf("Enter n number : ");
scanf("%d",&n);
printf("%d\t%d",f1,f2);
for(i=3;i<=n;i++)
{
f3=f1+f2;
printf("\t%d",f3);
f1=f2;
f2=f3;
}
getch();
}

Output :

Enter n number : 10
0 1 1 2 3 5 8 13 21 34

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

Can you explain the program of Fibonacci series in c?

You mean you have written a program, but you don't understand it? Well, how could I explain it without seeing it?


Why LED is used in the circuit diagram explain with reason?

Without seeing the actual diagram no real answer can be given.LEDs are used to generate light, often as status indicators.


Is it possible to generate dc power. if yes please explain.?

Solar electric (photo-voltaic or PV) panels "generate" DC power when exposed to the sun. For rotary type generation such as hydro, wind, diesel or steam turbine (fuelled by coal, natural gas or nuclear), the actual generator part of the system can generate AC or DC depnding on the generator installed for that application.


Can you give you the circuit to generate a sequence 1011010110 using multiplexer and how it is solved or the design?

The question is not clear can you go into discuss question and explain exactly what you want to do I'm sure I can help


Explain goto and return in c?

A return statement is used to transfer the program control flow to the function that has called the current function under execution. If the function is main, then the program returns the control flow to the operating system. The syntax for return statement is:return return-type;A goto statement is used to transfer the control flow to a particular labelled statement, not necessarily back to the calling program. There are somerestrictionson using a goto statement. For eg: the goto statement should not skip any variable declarations. The use of goto statement is usually considered as a bad programming practice. The syntax for goto statement is:goto label_name;....label_name: statements;

Related Questions

Explain how to find the terms of Fibonacci sequence?

If the Fibonacci sequence is denoted by F(n), where n is the first term in the sequence then the following equation obtains for n = 0.


Can you explain the program of Fibonacci series in c?

You mean you have written a program, but you don't understand it? Well, how could I explain it without seeing it?


What types of statement can be used to explain the steps of a proof?

The corollaries types of statement is what is used to explain the steps of a proof.


What types of the statement can be used to explain the steps of a proof?

The corollaries types of statement is what is used to explain the steps of a proof.


Explain with suitable example how switch statement is differ from if statement?

www.assignmentsclub.com


Explain numerical statements of facts that are not statistics?

all statistics are numerical statement but all numerical statement s of are not statistics explain


Can you explain Fibonacci's rabbit problem and find a diagram to explain?

Fibonacci's rabbit problem involves tracking the reproduction of rabbits over time, where each pair of rabbits produces another pair every month. The sequence of numbers that arises from this scenario is known as the Fibonacci sequence. A diagram typically shows the number of rabbit pairs at each time step, illustrating how the numbers grow according to the sequence.


What is used to explain something with a simple statement?

a generalization


Why did Fibonacci think the Fibonacci sequence was so interesting?

Because it is so interesting.. . .. ... ..... ........ ............. .....................Fibonacci first published a use for the pattern to explain bunny population growth in his book Liber Abaci (1202).Other interesting uses for the Fibonacci Sequence:The Golden Ratio and The Golden Spiral (as seen in DaVinci's Vitruvian Man)Phyllotaxis (how leaves appear on stem)Predicting stock share pricing (Fibonacci retractment)Graphs interconnecting parallel and distributed systems (Fibonacci Cubes)The Core in Cornwall, UK (architecture)The chorus of Astronomy, a hip-hop song by Black StarThe time signatures and syllable structure of the Toolsong LateralusAncestry of male bees


Explain this statement music is the fruit of love?

This statement is saying that music is inspired by love, and is the result of the latter.


How do you explain the structure of an analysis essay?

state the theme, back up your statement with evidence, then explain why it is universal


What does BAS stand for and explain its use?

business activity statement