Hi guys, I'm embarrassed to ask but, I'm struggling with this problem. I've been instructed to check if a number (inputted by a user) is a prime number or not. So far I've managed to show the fact that for example, 7/7=1 and 7/1=7 and that those are the only operations that have no remainder.
Now the trick is, getting the program to check and make sure that those two operations must be the only ones to have no remainder in order for it to tell the user that 7 is a prime number rather than the user judging for him/herself.
here's what I've done so far
ANY help would be greatly appreciated guys ;)
Now the trick is, getting the program to check and make sure that those two operations must be the only ones to have no remainder in order for it to tell the user that 7 is a prime number rather than the user judging for him/herself.
here's what I've done so far
Code:
Dim input As Integer
Dim test As Double
Dim i As Integer = 1
Console.WriteLine("Enter a number to see if it is a prime number")
input = Console.ReadLine()
Console.WriteLine(" ")
While (i <= input)
test = input Mod i
Console.WriteLine(test)
i = i + 1
End While
Comment