Тёмный

Frequently Asked Java Program 11: Check Given Number is Prime Or Not 

SDET- QA
Подписаться 714 тыс.
Просмотров 233 тыс.
50% 1

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/gdsfpb0s
Cucumber BDD Framework
***************************
► bit.ly/3F7d69r
Protractor with Javascript
***************************
► urlis.net/4uddm1qb
####################################
RU-vid 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

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

 

9 окт 2019

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 89   
@johnnyjohn9134
@johnnyjohn9134 4 года назад
You are a great teacher! Tell me please when do You LL make java and c++ pe phyton tutorials for begginers?!
@EdClarkHYCT
@EdClarkHYCT 4 года назад
Great video! Awesome solution! Keep up the great work!!👌👍👏
@sdetpavan
@sdetpavan Год назад
Thanks
@iamms351
@iamms351 3 года назад
Please add star pattern questions and metrics multiplication in this series
@Rhg2204
@Rhg2204 2 года назад
can we just loop till num/2 and make if statement to count=1? it will also show if its prime or not
@parshu3238
@parshu3238 3 года назад
This is grate explation for understand but we are using lot of loop, we should consider big O notation as well
@kassasuresh3909
@kassasuresh3909 11 месяцев назад
Ur way of teaching is verygood.
@neerajk_10
@neerajk_10 3 года назад
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.
@rishabhbillore7979
@rishabhbillore7979 2 года назад
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
@sirmonke8946
@sirmonke8946 Год назад
year old comment but it should be i
@akkiroy5871
@akkiroy5871 Год назад
@@rishabhbillore7979 we can change the condition as If(count==1) { System.out.println("prime no."); }
@arabindamohanty2190
@arabindamohanty2190 4 года назад
Really the way u explain I understood all the program 🙏🙏🙏
@sdetpavan
@sdetpavan Год назад
Thanks
@kaneezfatma4935
@kaneezfatma4935 3 года назад
Thnxx alot sir for explaining and clearing our logic
@sdetpavan
@sdetpavan Год назад
Welcome
@sweetyraghav9637
@sweetyraghav9637 Год назад
Superb explanation sir , really loved ur videos and very useful keep going
@sdetpavan
@sdetpavan Год назад
Thanks
@pravinbalwante3959
@pravinbalwante3959 Год назад
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)
@sangireddyeswarreddy1787
@sangireddyeswarreddy1787 3 года назад
Iam very much loved your way of explanation ❤️❤️❤️❤️❤️❤️ .
@sdetpavan
@sdetpavan Год назад
Thanks
@DomaninNicola
@DomaninNicola 3 года назад
this code is more efficient as it will first of all iterate trough half of the numbers, which significantly reduces the stress on cpu for bigger numbers secondarily, it will stop looking for numbers to increase the counter once we are sure the number is not prime (counter>=2) public static void main(String args[]) { int num = 13; int count=0; for( int i=(num/2); i>0; i-- ){ if( num%i == 0 ) { count++; if( count>=2) {System.out.println("Not a Prime Number"); break; } } } if(count
@lil.hercules
@lil.hercules Месяц назад
Iterate till square root of the number to reduce it even further
@vijayalakshmisuren3152
@vijayalakshmisuren3152 2 года назад
Very Good explanation... Thank you...
@sdetpavan
@sdetpavan Год назад
Most welcome
@lakshmidevilakshmidevi3984
@lakshmidevilakshmidevi3984 Год назад
Thanks for the clear explanation Sir
@sdetpavan
@sdetpavan Год назад
Welcome
@gauri992
@gauri992 3 года назад
ur the best sir
@samiullah2039
@samiullah2039 4 года назад
not palindrome but prime, small fix needed, Rest great explaination
@ravalipanja5194
@ravalipanja5194 3 года назад
Yeah..
@SUNNU-wg1sq
@SUNNU-wg1sq 5 месяцев назад
Great explanation sir....Thank you
@sdetpavan
@sdetpavan 5 месяцев назад
Welcome
@kmkbabu3
@kmkbabu3 3 года назад
Excellent bro
@RajeshPasupuleti-xn5ti
@RajeshPasupuleti-xn5ti Год назад
In if condition use if(count>=2) This gives good results
@tejajami6729
@tejajami6729 8 месяцев назад
sir, ones explain the print the 20th prime number program
@aloksinghkushwaha4615
@aloksinghkushwaha4615 3 года назад
how to find total prime number in range
@lakshmidevilakshmidevi3984
@lakshmidevilakshmidevi3984 Год назад
Best playlist .Thank you Sir
@surya-ow4wr
@surya-ow4wr 2 года назад
Not understood if(count ==2)
@sirmonke8946
@sirmonke8946 Год назад
//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
@UmmayamanAman
@UmmayamanAman Месяц назад
Prime number with in a range ?
@prasana98
@prasana98 Год назад
excellent explanation sir but you've mentioned 2 is not a prime number. that's wrong. 2 is a Prime number.
@yggamingtech6109
@yggamingtech6109 Год назад
How to print range of prime numbers
@SanjayVerma-qd3ur
@SanjayVerma-qd3ur 3 года назад
Explain tracing also
@vineelavineelapilla4117
@vineelavineelapilla4117 13 дней назад
Thank you so much Sir😊
@sdetpavan
@sdetpavan 4 дня назад
Welcome
@mahalakshmi-or9iq
@mahalakshmi-or9iq 2 года назад
Excellent Explanation
@sdetpavan
@sdetpavan Год назад
Thanks
@JanuJanu-iz7vw
@JanuJanu-iz7vw 2 года назад
Super explanation sir
@sdetpavan
@sdetpavan 2 года назад
thanks
@sanjayyadav-xe7mf
@sanjayyadav-xe7mf 2 года назад
best solution thanks a lot
@sdetpavan
@sdetpavan 2 года назад
Most welcome
@gokulkrish8139
@gokulkrish8139 2 года назад
Why this can't be put in Scanner Class??
@yashwantchawan96
@yashwantchawan96 Год назад
We can bro❤
@lakshmidevilakshmidevi3984
@lakshmidevilakshmidevi3984 Год назад
Very nice explanation
@sdetpavan
@sdetpavan Год назад
Thanks
@theoneinyou2233
@theoneinyou2233 Год назад
simply go like this public static String isPrime(int n) { for(int i=2;i
@maheshdeore7330
@maheshdeore7330 Год назад
Good Explanation
@sdetpavan
@sdetpavan Год назад
Thanks
@start1learn-n171
@start1learn-n171 3 месяца назад
TQ
@sdetpavan
@sdetpavan 3 месяца назад
Welcome
@aries2aqua
@aries2aqua 2 года назад
Thank you
@sdetpavan
@sdetpavan Год назад
welcome
@HarshTV97
@HarshTV97 2 года назад
Lets simplify this program::- main() { int num=10; int count=0; for(int i=2;i
@NuanDaa
@NuanDaa 2 года назад
this gives a result 9 is a prime number which in not
@duggirambabu7792
@duggirambabu7792 2 года назад
if(num%i==0) { count=1; break; }
@gautampandey1685
@gautampandey1685 9 месяцев назад
superbb
@sdetpavan
@sdetpavan 9 месяцев назад
Thanks
@prasadbuddhala758
@prasadbuddhala758 4 года назад
Good
@sdetpavan
@sdetpavan Год назад
Thanks
@vikashkr14296
@vikashkr14296 5 месяцев назад
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.
@kotaanirudh1388
@kotaanirudh1388 4 месяца назад
noob
@amritsnehi5975
@amritsnehi5975 Год назад
PALINDROME NUMBER BOL RHE SIR I THINK BY MISTAKE , PRIME NO HOGA NA SIR?
@amritsnehi5975
@amritsnehi5975 Год назад
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,
@satishgollu9106
@satishgollu9106 2 года назад
U r explaining prime number.... Not palindrome number🤷‍♂️
@aisumolda6794
@aisumolda6794 2 года назад
You said Prime number As a Polindrome Its not correct
@sdetpavan
@sdetpavan 10 месяцев назад
right
@shashankdwivedi4354
@shashankdwivedi4354 3 года назад
Please explain
@preetiparnasahoo5084
@preetiparnasahoo5084 2 года назад
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
@kvelez
@kvelez 10 месяцев назад
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
@ghareluupaylearnings
@ghareluupaylearnings 2 месяца назад
Lol 😂😂 explaining prime number and showing palindrome number 😂
@kaneezfatma4935
@kaneezfatma4935 3 года назад
Palindrome number 🤭🤭
@ashubtech9911
@ashubtech9911 3 года назад
In this large world....no can appreciate one's success....but they will definitely identify one's mistake....use common sense and appreciate him....
@based1708
@based1708 Год назад
This comment is so funny kek.
@priyanshumodiani_007
@priyanshumodiani_007 8 месяцев назад
😂
@hemmishra1102
@hemmishra1102 Год назад
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
@datareport1582
@datareport1582 Год назад
Nice explanation
@sdetpavan
@sdetpavan Год назад
Thanks
Далее
ВОТ ЧТО МЫ КУПИЛИ НА ALIEXPRESS
09:35
Просмотров 910 тыс.
Solve Any Pattern Question With This Trick!
57:20
Просмотров 2,3 млн
Java Program #6 -  Find Prime Numbers in Java
8:49
Просмотров 7 тыс.
Frequently Asked Java Program 13: Factorial of a Number
12:10
Check if given number is Prime Number | Java
7:10
Просмотров 195 тыс.
ВОТ ЧТО МЫ КУПИЛИ НА ALIEXPRESS
09:35
Просмотров 910 тыс.