Check Prime Number (for input)
hardQuestion 308Read an integer n from standard input and decide whether it is prime. Print exactly Prime if it is, or Not prime if it is not. A number is prime when it is greater than 1 and has no divisor other than 1 and itself.
For input 7 the output is exactly what is shown in Expected Output.
For input 9 the output is:
Not prime
Expected output
Prime= newline. The output ends with a newline, so print one after the last line.
Hints4 available
Sign in to use hintsTopics
Loops
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.