fibonacci series correct or not

##### Title

##### Question

fibonacci <- function(num1,num2){result <- num1+num2

for(i in 1){result <- c(num1,num2,result,result+i,result+result+i)}

return(result)}

fibonacci(1,1)

Sir I am getting the result 1,1,2,3,5

from the above function

is it correct

R Functions-in-R 11-12 min 10-20 sec

__Answers:__

Could you please explain the meaning of two arguments (num1 and num2) in your function?

Login to add comment