0

Explain pls the output of this code

public static void main(String[] args){ System.out.println(f(3)); } public static int f(int x){ if(x==0){ return 2; }else{ return 1+f(x-1); } } The output is 5.

30th Apr 2018, 8:37 PM
İskender Güneş
İskender Güneş - avatar
3 Antworten
30th Apr 2018, 8:50 PM
cyk
cyk - avatar
+ 1
cyk thankyou. that was useful 😊
1st May 2018, 1:27 PM
İskender Güneş
İskender Güneş - avatar
0
「HAPPY TO HELP」 thankyou for your help 😊
1st May 2018, 1:27 PM
İskender Güneş
İskender Güneş - avatar