#include using namespace std; void whosprime(long long x) { bool imPrime = true; for(int i = 1; i <= x; i++) { for(int z =
Try below code:
counter = sqrt(n) i = 2; while (i <= counter) if (n % i == 0) output i else i++