SyntaxFix
Write A Post
Hire A Developer
Questions
It's caused by n % x where x = 0 in the first loop iteration. You can't calculate a modulus with respect to 0.
n % x
x = 0