+ 1
2nd Jan 2020, 8:27 AM
Nagaraj P
Nagaraj P - avatar
5 odpowiedzi
+ 7
Just change else part using n * method(n - 1)
2nd Jan 2020, 8:54 AM
A͢J
A͢J - avatar
+ 4
Replace by this in your code if (num == 1) return 1; else return(num + method(num - 1));
2nd Jan 2020, 8:38 AM
A͢J
A͢J - avatar
+ 1
🅰🅹 - ɪ'ᴍ ᴄʀɪᴍɪɴᴀʟʟʏ ɢᴏᴏᴅ! Thank you Anant How can I get 6 as output which as factorial of 3
2nd Jan 2020, 8:43 AM
Nagaraj P
Nagaraj P - avatar
+ 1
Thank you 🅰🅹 - ɪ'ᴍ ᴄʀɪᴍɪɴᴀʟʟʏ ɢᴏᴏᴅ! Anant brother you are always best with Java...
2nd Jan 2020, 8:56 AM
Nagaraj P
Nagaraj P - avatar
0
Thank you Coder Kitten. got the exact definition what I looked for actually its a quiz in java sololearn...
2nd Jan 2020, 10:43 AM
Nagaraj P
Nagaraj P - avatar