In mathematics, the Fibonacci series is the series of the numbers where each number is the sum of the two preceding numbers, starting from 0 and 1.
Given two initial terms term1 and term2, we have to display the Fibonacci series till N terms.
Example:
Input:
term1 = 0
term2 = 1
N = 10
Output:
Fibonacci series: 0 1 1 2 3 5 8 13 21 34
Input:
term1 = 0
term2 = 1
N = 5
Output:
Fibonacci series: 0 1 1 2 3
Program to display Fibonacci series in Kotlin
Output
need an explanation for this answer? contact us directly to get an explanation for this answer