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

Programming Exercises

Generate Fibonacci series up to n terms.

Easy

Problem Statement

Generate Fibonacci series up to n terms.

Sample Input

n = 5

Sample Output

0 1 1 2 3 

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <stdio.h> int main() { int n = 5; int a = 0, b = 1, next; // Logic to generate Fibonacci series return 0; }
Log in or sign up to run or submit your code.Log inSign up
Input
n = 5
Expected Output
0 1 1 2 3