Skip to content
Algorithms
  • Home
  • IDE
  • Site Map
  • Difficulty Level
    • Beginner
    • Intermediate
    • Expert
  • Interviews
    • Amazon Questions
    • Goldman Sachs
    • Google Interview
    • Microsoft Interview
    • Apache
    • NetApp
    • Adobe
    • Facebook
    • NVIDIA
    • Oracle

Print First n numbers in Fibonacci Series

August 31, 2019September 5, 2018 by Sumit Jain

Objective: Write a program to print first n numbers in Fibonacci series.

Fibonacci number: First two Fibonacci numbers are defined as 0 and 1 and every number after the first two is the sum of the two preceding ones

Fibonacci Sequence- 0 1 1 2 3 5 8 13 21 34 55 89 ……..

Code:

Output:

First 10 elements in fibonacci series are:
0 1 1 2 3 5 8 13 21 34

Related Posts:

  • Collatz Conjecture - Maximum Steps takes to transform (1, N) to 1.
  • Print First N Prime Numbers - Java Code
  • Print Numbers from 1 to N without using loop
  • Minimum No of operations required to convert a given number to 1 - Integer…
  • Fizz Buzz Challenge - Java Implementation
  • Find all the Armstrong numbers in the given range
  • Floyd’s Triangle – Java Implementation
  • Minimum number of guesses needed to find a specific number
  • Swap two numbers using Bitwise XOR Operator
  • Find all Prime Numbers less than equal to N | Set 1
  • Check if given number is Prime - O(√N) Solution – Java Program
  • Numbers with prime set bits in a given range using Sieve of Eratosthenes Algorithm
  • Find all the numbers in the range which has prime set bits.
  • Find all possible combinations with sum K from a given number N(1 to N) with the…
  • Duplicate even elements in an array
Categories Beginner, MISC, Numbers Tags Beginner Leave a comment
Post navigation
Find the Area and Perimeter of Rectangle – Java Program
Heap Sort – Java Implementation



More Problems

  • Check if given number is Prime - O(√N) Solution – Java Program
  • Numbers with prime set bits in a given range using Sieve of Eratosthenes Algorithm
  • Find all the numbers in the range which has prime set bits.
  • Find all possible combinations with sum K from a given number N(1 to N) with the…
  • Duplicate even elements in an array
  • Print Number with its Sign in Java
  • Find all unique combinations of exact K numbers (from 1 to 9 ) with sum to N
  • Pascal Triangle
  • Determine the given routing number belong to which bank
  • Find Factorial of a given Number




Subscribe ( No Spam!!)

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,418 other subscribers

Recent Posts

  • Find departure and destination cities from the itinerary
  • Rank Array Elements
  • Three Consecutive Odd Numbers
  • Non-decreasing Array with one allowed change
  • Duplicate zero’s without expanding the array.
  • Maximum Depth of Valid Nested Parentheses
  • Decimal to Binary
  • Maximum Consecutive Ones
  • Duplicate even elements in an array
  • Minimum Increments to make all array elements unique






© 2021 Algorithms • Powered by GeneratePress