Тёмный

FIND GIVEN NUMBER IS PRIME OR NOT IN JAVA 

SiriSree Tech Tutorials
Подписаться 751
Просмотров 17 тыс.
50% 1

prime number in java
prime number program in java
prime number
prime or not in java
java prime number program
prime numbers
prime number or not
java prime number
prime number java
java
find prime number in java
java program to check prime number
write a java program to check prime number or not
java check prime number or not
find if a number is prime or not
java prime numbers
prime number in java 1 to 100
prime number or not in java

Опубликовано:

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 21   
@EDU_Chu
@EDU_Chu 24 дня назад
Actually we have to add a count variable and initialise to 0 and update after each divisible and if count == 2 print prime else non prime. In the particular program if gives u even or odd rather than prime and non prime.
@srikanthpelluru9994
@srikanthpelluru9994 22 дня назад
The for loop makes the difference. We are checking from 2 to given number -1. Of anything is divisible, then we are printing not prime and returning the cursor. It works for all the scenario
@vishaljadhav4652
@vishaljadhav4652 2 месяца назад
package JavaProgms; public class primeOrNot { public static void main(String[] args) { int num = 5; int count = 0; if (num > 1) { for (int i = 1; i
@nxplusgaming3583
@nxplusgaming3583 5 месяцев назад
Bro 9 is not prime but this programme is give output as prime It's just printing even and odd
@SiriSreeTechTutorials
@SiriSreeTechTutorials 5 месяцев назад
I’m not sure why you guys get such wrong output. For me it is working fine. Please do double check the program
@nxplusgaming3583
@nxplusgaming3583 5 месяцев назад
@@SiriSreeTechTutorials no bro program is right i was wrong sorry 😔
@vishaljadhav4652
@vishaljadhav4652 2 месяца назад
package JavaProgms; public class primeOrNot { public static void main(String[] args) { int num = 5; int count = 0; if(num > 1) { for(int i = 1; i
@nileshgurung9437
@nileshgurung9437 9 месяцев назад
What if we put 2
@SiriSreeTechTutorials
@SiriSreeTechTutorials 9 месяцев назад
Then this will get fail… I notice that and expect the question from followers. Before if, we should check the value is greter than 2 or not, if not then print as not prime and return..
@himanshulowanshi5121
@himanshulowanshi5121 8 месяцев назад
This program is even odd numbers
@SiriSreeTechTutorials
@SiriSreeTechTutorials 8 месяцев назад
If it is even odd number program, I would have written (num%2==0) condition, why we need for loop before this condition. And then I am verifying (num%i == 0) That makes this program as prime or not
@chin2vk214
@chin2vk214 8 месяцев назад
This is a fake one if we give some odd multiple it won’t work. For example 33
@SiriSreeTechTutorials
@SiriSreeTechTutorials 8 месяцев назад
No words broo. I don’t know whether you tried or not. Please try once and make a comment
@aviligondarakesh4477
@aviligondarakesh4477 5 месяцев назад
Bro true
@aviligondarakesh4477
@aviligondarakesh4477 5 месяцев назад
​@@SiriSreeTechTutorialsnuvvu thappu ichi cover chesukovadhu
@omhatgaonkar2755
@omhatgaonkar2755 9 месяцев назад
But if we put 1 it says it is prime, and 1 is not prime number
@SiriSreeTechTutorials
@SiriSreeTechTutorials 9 месяцев назад
Yeah. Before for loop, we should write an if condition. Thanks for finding this.
@tanayhalder6340
@tanayhalder6340 3 месяца назад
this program will not work for 9 also dlt this fake vid
@aviligondarakesh4477
@aviligondarakesh4477 5 месяцев назад
Bro this is fully wrong bro
@SiriSreeTechTutorials
@SiriSreeTechTutorials 5 месяцев назад
I’m not sure why this program does not work for you guys.
@aviligondarakesh4477
@aviligondarakesh4477 5 месяцев назад
@@SiriSreeTechTutorials actuqlly here whats going is i%j in the condition , 2 will be looping here , but not work on 3 and 5 and 4 thats the problem
Далее
GIVEN NUMBER IS PALINDROME OR NOT IN JAVA
1:00
Просмотров 2,7 тыс.
Giant Silver Chocolates ASMR With My Sister! 🤤
00:46
Coding Was HARD Until I Learned These 5 Things...
8:34
OpenAI’s New ChatGPT: 7 Incredible Capabilities!
6:27
Why You Shouldn't Nest Your Code
8:30
Просмотров 2,7 млн