Frequently Asked Java Program 11: Check Given Number is Prime Or Not
HTML-код
- Опубликовано: 17 окт 2024
- Frequently Asked Java Program
Check Given Number is Prime Or NotPrime Number:
------------------------------
Natural Number greater than 1
Which has only 2 factors 1 and itself
19 1 and 19 Prime Number
28 1,2,4,7,14,28 Not a Prime Number
Examples: 2, 3, 5, 7, 11, 13, 17..
#########################
Udemy Courses:
#########################
Manual Testing+Agile with Jira Tool
************************************
► shorturl.at/xNXZ4
Selenium with Java+Cucumber
********************************
► shorturl.at/aIKMW
Selenium with Python & PyTest
********************************
► shorturl.at/ELW09
Selenium with python using Robot framework
****************************************
► shorturl.at/bcDPZ
API Testing(Postman, RestAssured & SoapUI)
*****************************************
► shorturl.at/uAWY7
Web & API Automation using Cypress with Javascript
********************************************
► rb.gy/4uum2n
Playwright with Javascript
**************************
► shorturl.at/gALZ1
Jmeter-Performance Testing
************************
► rb.gy/ocj7r2
SDET Essencials(Full Stack QA)
*************************
► rb.gy/hlnf2v
Appium-Mobile Automation Testing
************************************
► rb.gy/wmzv64
Java Collections
*****************
► bit.ly/3S66ezE
Python Programming
*********************
► urlis.net/gdsf...
Cucumber BDD Framework
***************************
► bit.ly/3F7d69r
Protractor with Javascript
***************************
► urlis.net/4udd...
####################################
RUclips Playlists:
####################################
Manual Testing & Agile
***********************
► bit.ly/3ujvaYa
► bit.ly/3OYzxQj
SQL
*************************
► bit.ly/3R6XjeG
► bit.ly/3nE0a1s
► bit.ly/3IeKuuJ
linux & Shell Scripting
**********************
► bit.ly/3up1Z6a
► bit.ly/3nzvGxx
Java
**********************
► bit.ly/3R9QfOs
► bit.ly/3AoRMKM
► bit.ly/3IbTTDn
► bit.ly/3ybXInv
► bit.ly/3yCoHdw
Selenium With Java+Cucumber
********************************
► bit.ly/3P2FMm4
► bit.ly/3yhiIt4
► bit.ly/3uokzet
► bit.ly/3a7XIND
► bit.ly/3umN2S9
► bit.ly/3aar7GW
► bit.ly/3y9kD2S
► bit.ly/3uhLskn
Python
********************************
► bit.ly/3agNgU0
► bit.ly/3NJNnoy
► bit.ly/2CTQ4mR
► bit.ly/3OIYWh1
Selenium With Python,Pytest&Behave
***************************************
► bit.ly/3OHHoC9
► bit.ly/3IeNLdv
► bit.ly/2J4tPeT
► bit.ly/3ydSkAq
Selenium With Python Using Robert Framework
(Web&API Testing)
*************************************************
► bit.ly/3nUvlpr
► bit.ly/3nUvE3z
API Testing (Postman,SoapUi,&Rest Assured)
**********************************************
► bit.ly/3OXacWY
► bit.ly/3yh0UhE
► bit.ly/3nC9DWQ
► bit.ly/3yGfhNS
► bit.ly/3OJa11H
► bit.ly/3P2slCC
Mobile App Testing Appium
****************************
► bit.ly/3Al49HG
Performance Testing Jmeter
*******************************
► bit.ly/3nz4fE7
Maven,Jenkins,Git,Github,CI/CD
*******************************
► bit.ly/3P16HPj
► bit.ly/3yhlUVA
► bit.ly/3afYfwT
► bit.ly/3yGzweG
► bit.ly/3yF73Ws
► bit.ly/3NCOmH7
SQL,DB Testing&ETL,Bigdata
*******************************
► bit.ly/3NKOcNY
► bit.ly/3OVpDyI
► bit.ly/3NEvUy0
► bit.ly/3IryxlT
► bit.ly/3RkWBLh
JavaScript Based Automation Tools
********************************
► bit.ly/3nUx51X
► bit.ly/3AqI6Q0
► bit.ly/3yeurbT
► bit.ly/3ujzpTK
Selector Hub Tools
********************
►rb.gy/h3h424
GraphQL
******************
► rb.gy/sj3gys
Cypress API Testing
********************
► shorturl.at/fjKPX
Cypress Web Testing
**********************
► shorturl.at/agjlK
Playwright with Javascipt
**************************
► shorturl.at/adSTY
#PrimeCheck
#PrimeOrNot
#PrimeTest
#IsItPrime
#PrimeNumber
#NumberTheory
#Mathematics
#NumberProperties
#Primality
#NumberAnalysis
#PrimeAlgorithm
#NumberDivisibility
#NumberTheory101
#NumberPuzzles
#MathPuzzles
#PrimeChallenge
#MathHelp
#NumberCuriosity
#MathEnthusiast
#NumberQuiz
#PrimeSieve
#NumberPatterns
#PrimeExploration
#MathGeek
#PrimeDiscovery
#NumberInvestigation
#PrimeInquiry
#MathMagic
#PrimeWisdom
#NumberInsight
#PrimeQuest
#MathWhiz
#PrimeInsights
#NumberMagic
#PrimeJourney
#MathChallenge
#NumberAdventures
#PrimeJungle
#MathWonders
#PrimeInspection
#NumberPioneers
#MathExploration
#PrimeHunters
#NumberMysteries
#PrimeOdyssey
#MathPioneers
#NumberGenius
#PrimeVenture
#MathAdventures
#NumberGeniuses
Good explanation. But I think we should further optimize it by keeping the limit to i 2. If yes, immediately exit the loop. This will save a lot of time for big numbers.
no bro what if i input 5 than it will only divide 5 with 1 and 2 so the count will be 1 only so it will give output that 5 is not prime number
year old comment but it should be i
@@rishabhbillore7979 we can change the condition as
If(count==1)
{
System.out.println("prime no.");
}
//This is an old video but I think this is a better solution
class Main {
public static void main(String[] args) {
int num = 3;
boolean isPrime = true; //default
for (int i=2; i
Please add star pattern questions and metrics multiplication in this series
not palindrome but prime, small fix needed, Rest great explaination
Yeah..
first use "if". condition for number greater than 1 and then take inner if for scond condition that is (number divided by 2 it give remainder 1) and print statment for inner if is (it is prime number) otherwies take else (not prime)
Ur way of teaching is verygood.
Thanks sir
You are a great teacher! Tell me please when do You LL make java and c++ pe phyton tutorials for begginers?!
Great video! Awesome solution! Keep up the great work!!👌👍👏
Thanks
Lets simplify this program::-
main()
{
int num=10;
int count=0;
for(int i=2;i
this gives a result 9 is a prime number which in not
if(num%i==0)
{
count=1;
break;
}
@@NuanDaa No it's correct
can we just loop till num/2 and make if statement to count=1? it will also show if its prime or not
Thanks sir ❤..You are very great..explained in a very simple manner 🙏👌🤌
It's my pleasure
Really the way u explain I understood all the program 🙏🙏🙏
Thanks
simply go like this
public static String isPrime(int n)
{
for(int i=2;i
Great explanation sir....Thank you
Welcome
Superb explanation sir , really loved ur videos and very useful keep going
Thanks
In if condition use if(count>=2) This gives good results
This is grate explation for understand but we are using lot of loop, we should consider big O notation as well
Thanks for the clear explanation Sir
Welcome
Iam very much loved your way of explanation ❤️❤️❤️❤️❤️❤️ .
Thanks
Thnxx alot sir for explaining and clearing our logic
Welcome
excellent explanation sir but you've mentioned 2 is not a prime number. that's wrong. 2 is a Prime number.
Very Good explanation... Thank you...
Most welcome
Why this can't be put in Scanner Class??
We can bro❤
Nice explanation
Thanks
best solution thanks a lot
Most welcome
Sorry to interrupt you but till 5:33 you are talking about palindrome number and your title is not matching with our voice.
I can't imagine how did you uploaded this video.
noob
Prime number with in a range ?
Thank you so much Sir😊
Welcome
Best playlist .Thank you Sir
sir, ones explain the print the 20th prime number program
Very nice explanation
Thanks
Super explanation sir
thanks
Not understood if(count ==2)
ur the best sir
Excellent Explanation
Thanks
Good Explanation
Thanks
How to print range of prime numbers
Explain tracing also
how to find total prime number in range
Excellent bro
superbb
Thanks
TQ
Welcome
PALINDROME NUMBER BOL RHE SIR I THINK BY MISTAKE , PRIME NO HOGA NA SIR?
I WATCHED YOUR ALL VIDEOS OF THIS PLAYLIST, REALLY AMAZING CONTENT, I THINK THIS PLAYLIST WILL EXPERT TO ME IN JAVA, U ARE THE GOD OF MY LIFE DURING THIS PERIOD TEACHING JAVA,
You said Prime number As a Polindrome Its not correct
right
U r explaining prime number.... Not palindrome number🤷♂️
You should've watched till the end
Thank you
welcome
Efficient code:
public class PrimeNumber {
public static void main(String[] args) {
int n = 27;
if (n < 2) {
System.out.println("Not prime");
return;
}
for (int i = 2; i * i
Lol 😂😂 explaining prime number and showing palindrome number 😂
Good
Thanks
package javaapplication23;
import java.util.Scanner;
public class JavaApplication23 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Num: ");
int n = scan.nextInt();
String value = "";
for (int i = 2; i
Palindrome number 🤭🤭
In this large world....no can appreciate one's success....but they will definitely identify one's mistake....use common sense and appreciate him....
This comment is so funny kek.
😂
Please explain
import java.util.Scanner;
public class PrimeNumber {
public static void main(String[] args) {
System.out.println("Enter a number:");
Scanner sc=new Scanner(System.in);
int num ;
num =sc.nextInt();
int i=1;
int count=0;
if (num!=1)
{
while (i