We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f3aaffd commit c9bdb5bCopy full SHA for c9bdb5b
app/src/main/java/hexlet/code/Prime.java
@@ -7,12 +7,11 @@ public class Prime {
7
public static void gameLogic() {
8
Scanner sc = new Scanner(System.in);
9
Random randNum = new Random();
10
- boolean isPrime = true;
11
Engine.userGreetings();
12
System.out.println("Answer 'yes' if given number is prime. Otherwise answer 'no'.");
13
while (Engine.questionCounter != 3) {
14
int num = randNum.nextInt(2, 1000);
15
- isPrime = true;
+ boolean isPrime = true;
16
System.out.println("Question: " + num);
17
for (int i = 2; i <= Math.sqrt(num); i++) {
18
if (num % i == 0) {
0 commit comments