#include int isPrime(int i) { if (i < 2) { return 0; } int j, k = sqrt(i); for(j = 2; j <= k; j++) { if (i % j == 0) { return 0; } } return 1; }