Computer Science, asked by sp2003, 1 year ago

write a program to accept a number and display fibonacci series upto that number.Display an appropriate message if that number does not exist in the series.
pls be accurate .Answer only if you know.*****NO SPAMMING PLEASE*****


sp2003: IN JAVA

Answers

Answered by 12353
0
Example on how to display the Fibonacci sequence of first n numbers (entered by the user) using loop.Also in different example, you learn to generate the Fibonacci sequence up to a certain number.

0, 1, 1, 2 , 3, 5, 8 ,13 , 21 , 34 ,55 ,89 ,144

To understand this example, you should have the knowledge of following C programming topics:

* C programming Operators

* C programming while and do ... while loop.

* C programming for loop.

* programming break and continue statement.

# include<stdio.h>

int main ( )
{
int I , n, t1=0,t2 = 1. , next term ;
printed("Enter the vnmber of terms:")

Scandinavian("% d " ,&n) ;

printed("Fibonacci series:")

for (I. =1; I <= n; ++i)

{

printed("%d, "t1)

next term =t1+t2
t1 = t2
t2 = next term

}

return 0;


}

12353: please mark me as brainlist
sp2003: How do you check if it doesn't exist in series
Similar questions