From 00110158716638301cf987455ce05d191a48707e Mon Sep 17 00:00:00 2001 From: Devesh Mehara <96515074+MehraDevesh2022@users.noreply.github.com> Date: Wed, 5 Oct 2022 17:46:11 +0530 Subject: [PATCH] update added --- algorithms/Java/Maths/check-prime-or-not.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/algorithms/Java/Maths/check-prime-or-not.java b/algorithms/Java/Maths/check-prime-or-not.java index 0a1f2ca2..354c9de3 100644 --- a/algorithms/Java/Maths/check-prime-or-not.java +++ b/algorithms/Java/Maths/check-prime-or-not.java @@ -10,7 +10,7 @@ public class main { public static boolean isPrime(int num) { for (int i = 2; i * i <= num; i++) { - if (num % 2 == 0) { + if (num % i == 0) { return false; } }