Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Print the Fibonacci series up to a given number

Easy

Problem Statement

Print the Fibonacci series up to a given number

Sample Input

5 terms

Sample Output

0, 1, 1, 2, 3

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
fun main() { val terms = 5 // Add your code here to print the Fibonacci series }
Log in or sign up to run or submit your code.Log inSign up
Input
5 terms
Expected Output
0, 1, 1, 2, 3