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
- C++ Program to print Fibonacci Series using Class template
- Program for Fibonacci numbers
- C Program for Fibonacci numbers
- C++ program to print all Even and Odd numbers from 1 to N
- Program to print first N Prime numbers
- Program to print non square numbers
- Program to print a pattern of numbers
- Python program to print all even numbers in a range
- 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 in digital form
- Program to print numbers columns wise