#Trying to find if the number is prime or not
1 messages · Page 1 of 1 (latest)
its a bot, and as adviced in the other thread, fix your variables,they are not correct
You haven't asked your question
I was just trying to figure out what went wrong with my code.
Question: Finding a prime number, but it doesn't give the right output.
and so, what went wrong ?
It gives me the wrong output, that means it can't identify if the number is prime, or not.
It just gives me the output, not a prime number.
Even if I put in 19, or 17.
wdym, what does it give, for which input ?
do not spoonfeed plz
The code's wrong.
code is correct
Suppose I input the number 19, which is a prime number. The code however is wrong, and won't return me, '19 is not a prime number.'
maybe its doing what the definition of a prime is
what does it print ?
'19 is not a prime number.'
it is, he's using if(VALUED%checkNumber == 0) {
Look at the print statement
so it says Number is not Prime
Yes.
It's not giving me any problems so far.
try an even number
try 15
yes
read your code again
maybe use a debugger
but try to understand how your method works