I need to run fibonacci series through function in Octave.
I got the expected output, but my test case fails due to indendation in output.
function fibo(n)
a=0;
b=1;
x(:,1)=[1];
for i=2:n
c=a+b;
x(:,i)=[c];
a=b;
b=c;
endfor
g=sprintf("%d ",x);
fprintf("Fibonacci sequence: %s\n",g)
endfunction
a = input("");
fibo(a)
if Input = 10, Output: (Test case failed)
When using
g=sprintf("\t%d",x);
the following output is getting displayed:
Can anyone help me with passing the test case by resolving indentation!