I have this code in a function, but when it runs it does a long pause and then it says:
$floating point exception
I am assuming this is due to
You will get into an infinite loop when the if-statement is reached. This will cause the error. You probably wanted to stop the loop if j == 1? Then you had to write
if
j == 1
for (i = 2; (i < number || j!=1); i++)