Following is simple program to print first n Fibonacci numbers.
Input : n = 3 Output : 1 1 2 Input : n = 7 Output : 1 1 2 3 5 8 13
1 1 2 3 5 8 13
Time Complexity : O(n)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geekforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Print first n Fibonacci Numbers using direct formula
- Program to print Fibonacci Triangle
- Program for Fibonacci numbers
- C Program for Fibonacci numbers
- Program to print non square numbers
- Program to print a pattern of numbers
- Program to print numbers columns wise
- Program to print all the numbers divisible by 3 and 5 for a given number
- Python Program to Print Numbers in an Interval
- Python program to print even numbers in a list
- Python program to print all odd numbers in a range
- Python program to print odd numbers in a List
- Program to print numbers with diamond pattern
- Program to print numbers in digital form
- Python program to print all even numbers in a range