Fibonacci Sum in Range
Practice
3 (1 votes)
Problem
21% Success 23 Attempts 5s Time Limit 256MB Memory 1024 KB Max Code
Write a program to print the sum of Fibonacci numbers in a given range. Assume the Fibonacci series starts as 0, 1, 1, 2, 3....
Input
An integer T, denoting the number of testcases, followed by T lines, each containing two integers L, R.
Output
Print the sum of all Fibonacci numbers between the Lth and Rth Fibonacci numbers. The Rth
Fibonacci number is excluded from the sum.
Input Constraint
1 <= T <= 100
0 <= L, R < 100
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
8 votes
Tags:
MathematicsMedium
Points:20
2 votes
Tags:
MathematicsEasyEasy
Points:10
82 votes
Tags:
Basic ProgrammingEasy
Editorial
No editorial available for this problem.