Premium Minds Interview Question

Make a fibonacci function recursively.

Interview Answer

Anonymous

Dec 21, 2020

static void printFibonacci(int count){ if(count>0){ n3 = n1 + n2; n1 = n2; n2 = n3; System.out.print(" "+n3); printFibonacci(count-1); } }