Prime Number C Logic