I am trying write some C# code, that finds all the prime numbers between 1-100 and I cannot figure out how to reconize that the numbers are prime. Any help suggestions? I also need to average them afterwards, I have no problem doing that though, and I know what the prime numbers from 1-100 are, but I want the program to do it.
The only thing I have came up with would be to make one method for prime that declares all the prime numbers, and then the main loop that counts from 0 to 100 and check each number for primality.
The only thing I have came up with would be to make one method for prime that declares all the prime numbers, and then the main loop that counts from 0 to 100 and check each number for primality.