+ 2

Why doesn't this code run?

https://code.sololearn.com/c074jQuHDR74/#java It is the problem #3 of Project Eular (https://www.projecteular.net). The program runs fine with a low value for 'number'.

30th Dec 2017, 1:38 AM
Gammaburst
Gammaburst - avatar
2 Answers
+ 3
@Gamma Guy please comment out the package line, I can get your code to run in Code Playground with it being commented, maybe Code Playground limit?
30th Dec 2017, 3:09 AM
Ipang
+ 1
Ipang, sorry I forgot to comment it before as I was working on it in BlueJ and copied the code here for help. Yes, Code Playground has a limit but copy this code and run it on an IDE on your computer and then it will show "java.lang.ArithmeticException: / by zero" in line 15.
2nd Jan 2018, 1:56 AM
Gammaburst
Gammaburst - avatar