79563428

Date: 2025-04-09 03:57:31
Score: 1.5
Natty:
Report link

πŸ” Problems in your code: Incorrect Prime Check Logic:

You're looping for (i = 2; i <= a; i++), and inside that, you're modifying a (a++). That's the core issue β€” modifying the loop condition variable inside the loop can cause an infinite loop.

if(a % i != 0) is not sufficient to check primality β€” a number is prime only if it's not divisible by any number from 2 to √n.

You're logging prime or not prime for every iteration, which isn’t correct behavior

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Amira Akram