So my program is supposed to do this "Write a function name isPrime, which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise." , other requirements were to use bool, and to also name the previous prime numbers to the number that was inputted. I have been able to do that part, I just cant get the bool variable to work to tell me to be able to have the program show if it is a prime number or not. I need help to find where i am making the mistake in the program, thank you.
Lines 33 to 39 will never happen, because your function returns before then. Your function basically always returns true. What about when the number isn't a prime number?
would a if else statement in the bool isPrime function solve the problem? that is what i am stuck on, that the program never gives me an output for when the number is not a prime number.