Fibonacci Series : It is one of the famous series in maths and also a favorite program for the interviewer. In 8 out of 10 interviews the Fibonacci series program is asked so you should definitely prepare it. Below we have solved the code for series up to a given term / number.
Program to print Fibonacci Series
Logic :
- Keep the first term as 0 & second term as 1.
- Input the number till you want to print the series.'
- Print first term
- Calculate the sum of two terms store in first and print
- Keep on repeating till sum sum does not exceed our given number.
0 Comments