Program to Print All Prime Numbers between 1 to 100 in Java by Deepak

preview_player
Показать описание
#java #javatutorials #deepak #smartprogramming
📞 For more details Call or What's App : +91 98887-55565

------------------------------------------------------------------------------------------

#PrimeNumbers #PrimeNumberProgram #java #hindi #deepak #JavaTutorials #DeepakPanwar #OnlineTraining #OnlineClasses
Program to Print All Prime Numbers between 1 to 100 in Java by Deepak,
Write a program to print prime numbers between 1 to 100,
How to find Prime Numbers between 1 and 100,
Prime Numbers - The Sieve of Eratosthenes,
Prime Numbers up to 100 | Coaching Classes,
Math Video on Prime & Composite Numbers 1 to 100 - What are they ?
How to get prime numbers in java,
Program to print all prime numbers between two numbers in C,
Finding Prime Numbers.

------------------------------------------------------------------------------------------

Follow Me On Social Media :-
Рекомендации по теме
Комментарии
Автор







▶ Core Java Chapter-wise Playlist ◀




▶Advance Java Chapter-wise Playlist ◀

SmartProgramming
Автор

Logic appreciated 👍
But
1 is not prime number... Prime number starts from 2

saurabhwaghmare
Автор

Sir can u please explain the working of the loop at the point of j<i-1.
What value does i hold
Because i dont understand

pinkcodermedia
Автор

Very nice explanation, i am having my ip boards, and it really felt very helpful. Thanku Sir !!!

ayushgarg
Автор

Yes sir, basically am not saw hindi videos but am fall in your program structure in simple way.. beautiful 👌👍🔥

vinaykumarmb
Автор

Hi Deepak Sir,
Greetings and applaud the effort put by you.
In the above program 1 is also printed but 1 is neither prime or composite so i have put a correction marked in bold.. I need your approval comment on that so that other who are referring the program do not make that mistake in interviews




public class ListOfPrimeNumbers {


public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
System.out.println("Enter Starting Number");
int startpoint=sc.nextInt();
System.out.println("Enter End/Last Number");
int endpoint=sc.nextInt();
int divcount=0;
if(startpoint==1)
{
startpoint=startpoint+1;
}
for(int
{
for(int
{
if(num%counter==0)
{

}
}
if(divcount==0)
System.out.print(num+" ");
else
{
divcount=0;
}
}


}


}

pawanpriyadarshi
Автор

great explanation! thanks for the solution

to anyone wondering about it, to take user input & also, make use we dont print 0 and 1,
we could use the continue statement inside the outer for loop.

import java.util.Scanner;
class Main{
public static void main(String args[]){
Scanner sc=new Scanner(System.in);
int n1=sc.nextInt();
int n2=sc.nextInt();
for(int i=n1;i<=n2-1;i++){
int temp=0;
if(i==0 || i==1){
continue;
}
for(int j=2;j<=i/2;j++){
if(i%j==0){
temp++;
break;
}
}
if(temp==0){
System.out.print(i+" ");
}else{
temp=0;
}
}
}
}

Hope this helps!

Ndbdbbdbdbh
Автор

What a Superb Explanation Sir, Thank you so much for this amazing video.It cleared my all doubt.

rakeshbalwant
Автор

thankyou very much deepak sir....thanks a lot.
but sir 1 prob hai ki output me 1 bhi show kr rha which is not a prime no bcz 1 only has one positive divisor (1 itself), so it is not prime. islie jo pehla loop hai na sir usme starting 2 se 100 tak ka krna hoga nhi to jo condition check kr rhe hamlog if(temp==0 ) usko replace krke hamlogo ko if(temp==0&&!=1) shayd to kahi ho jaye
well i love you sir you are my favourite com teacher.

karansharma
Автор

Best teacher for java programming language ❤

Asadullah_BalochOfficial
Автор

AMAZING CONTENT I HAVE EVER SEEN .KEEP IT UP

ManpreetSingh-tnjm
Автор

Thankyou sir for this wonderful explanation. It really helped me a lot..😊😊

tarannumkhan
Автор

sir if i want to print prime number between 1 to 100 as how to do this.

mamtasinha
Автор

GREATE TEACHING SIR AM TOTALLY UNDERSTOOD, , , GBU SIR

vidyajadhav
Автор

thank u sir your videos help me a lot in my studies

anitahudda
Автор

Thank u sir..I think that is very easy way to solve this problem ..

event
Автор

ty sir, tmr i have my computer boards well prepared ty so much...

raghavvhanchate
Автор

wahhh sir g
very nice teaching ability

complereinfosystem
Автор

I made changes and user can select range to find list of prime numbers. #thankyou sir you are great

TheOne-zwzl
Автор

Thank you so much. This is really helpful.

PoonamSharma-kkmq
join shbcf.ru