what output you are getting by this ?
Also what is the requirement of this section ?
mf_arian wrote:
switch(fib)
{
case 0:
System.out.printf(" Sorry, no result for f(0)");
break;
case 1:
System.out.printf(" Fib(1) = 0");
break;
case 2:
System.out.printf(" Fib(1) = 0");
System.out.printf(" Fib(2) = 1");
break;
default:
Actually you are setting fib = 0 and then using switch block, so every time the program enters the switch it will print Sorry, no result for f(0)
and exit.
So the issue is with the switch. :rose: