This program I have written up has to print all the prime numbers between 1-10,000 However, for some reason, its only prints out prime numbers up to 29.

Thanks in advance to anyone that could help rectify this problem.Code:#include <stdio.h> #include <math.h> #include <conio.h> int number, result, numerator; int primenum(int number) { numerator = (int)pow(2, number); return numerator; } int main(void) { for(number = 1; number >= 0 && number <= 10000; number++) { //result = primenum(number); if(primenum(number) % number == 2) { printf("%d is a prime number\n", number); } //else //{ //printf("%d is not a prime number\n", number); //} //printf("%d square is %d\n", number, result); } getch(); return 0; }