Fibonacci Series

Medium
Description:

The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones. The sequence starts as: 0, 1, 1, 2, 3, 5, 8, 13, ... Write a program to print the first N terms of the Fibonacci series. Input Format: An integer N — the number of terms to print. Output Format: Print N space-separated integers representing the Fibonacci sequence. Constraints: 1 ≤ N ≤ 50

Input Format:

An integer N — the number of terms to print.

Output Format:

Print N space-separated integers representing the Fibonacci sequence.

Tags:
Math
Sample Input:
7
Sample Output:
0 1 1 2 3 5 8