Make your own free website on Tripod.com
#include <stdio.h>

#define NMAX    100

int check_prime(int n) {
    int i, s;
    if (n > 2)
        for (i = 2;i < n;++i)
            if (n % i == 0) {
                s = !s;
                break;
            }
    if (!s)
        return (0);
    else
        return (1);
}

main() {
    int i, ii, n;
    i = n = 1;
    do {
        if (check_prime(n) == 1) {
            printf("%d\n", n);
            ++i;
        }
        ++n;
    } while (i <= NMAX);
}