The final product is http://www.sonic.net/~stevetux/thanks-nblug_primes.c Thank you, everyone who helped. This is my first experience with open source programming, and I'm extremely impressed. :-)