write a program to print fibonaaci series like 2,1,3,4,7,11,18 up to 10th term using function...end function

I did it using SUB..end sub in this way :
declare sub series
cls
call series
end
sub series
a=2
b=1
for p =1 to 5
print a; b
a=a + b
b=b + a
next p
end sub

How do you do it using FUNCTION...END FUNCTION
0 following

1 answer

use the function to calculate the nth fib #, and return its value.

Then loop for p=1..5 and print each value returned.
Similar Questions
  1. rem prints fibonacci seriescls a=2 b=1 for p = 1 to 5 print a print b a=a + b b=b + a next p end I have done this program. How
    1. answers icon 3 answers
    1. answers icon 1 answer
  2. What error in this program needs to be fixed?def sum(num1, num2): return num1 + num2 print(sum(4, 5.5, 6)) (1 point) The sum
    1. answers icon 1 answer
    1. answers icon 0 answers
more similar questions