Improve program readability and coding convention

This patch modifies the primality test to use better programming conventions such as using boolean values for true/false variables and properly prints out the primes that are less than 3.