Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
0
Yep it's okay. It's just a bit heavy to calculate the factorial of great numbers so your phone might simply take forever for that calculation. The only thing to prevent that is to limit the user input to 70 e.g. as max number. And btw. I wouldn't use break, I'd use the for loops condition instead, that's just cleaner and easier to read :)
31st Aug 2019, 6:34 PM
Aaron Eberhardt
Aaron Eberhardt - avatar