id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > lowFib
prev  |  next  |  chance

Write a method that returns the highest Fibonacci number that is less than to the integer input parameter. Remember that Fibonacci numbers follow the pattern 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, etc. Notice that the first two Fibonacci numbers are both 1. To find any other Fibonacci numbers, just add the two previous numbers. For example, 13+21=34.


lowFib(2) → 1
lowFib(11) → 8
lowFib(44) → 34

...Save, Compile, Run (ctrl-enter)

public int lowFib(int topNum) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 250

Copyright Nick Parlante 2017 - privacy