Programming Exercises

Print the first 10 elements of the Fibonacci sequence.

Medium

Problem Statement

Print the first 10 elements of the Fibonacci sequence.

Sample Input

10

Sample Output

0 1 1 2 3 5 8 13 21 34 

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <stdio.h> void printFibonacci(int n) { // Your code here } int main() { printFibonacci(10); return 0; }
Log in or sign up to run or submit your code.Log inSign up
Input
10
Expected Output
0 1 1 2 3 5 8 13 21 34