π 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