Hello everyone, i have a question. I don’t get this challenge, what am i suppose to do to the number and the fibonacci numbers that are less than the number?
To make it clear, these are lists of things i understood and this i don’t understood yet:
What i am aware of:
1- what are fibonacci numbers
2- we need to see if the fibonacci numbers are less or equal to the number
3- owe need to see if the fibonacci numbers are also odd
4- we need to sum all odd fibonacci numbers that are less or equal to the number
What i don’t get:
1- how come the return result.
For example. How if we pass 4 to the arguments we will return 5, why process we need to follow? What do we need to do with the fibonacci odd numbers and the number?
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15
Challenge Information:
Intermediate Algorithm Scripting - Sum All Odd Fibonacci Numbers
sanity has provided an excellent example above. I would just add that you need to somehow iterate over the num argument to get all the odd numbers. At this point, I’m sure you’re familiar with the syntax to perform iteration.
Once you get that, ask yourself what you can do to fulfill the task. The key is:
Return the sum of all odd Fibonacci numbers that are less than or equal to num.
Take your time to read through the instructions. You can do this