Write program for to print prie numbers:
Definition:
A prime number is a whole number greater than 1, whose only two whole-number factors are 1 and itself. The first few prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29.
Out put:
INTERVIEW QUESTION FOR JAVA
Java program for EMPLOYEE DETAILS
Java program for MULTIPLE THREADS ACCESSING ONE METHOD
Java program for SINGLE THREADS ACCESSING ONE METHOD
Java program for Strin Reverse
java Program for Twin Prime numbers
JAVA PROGRAM FOR EQUILATERAL TRIANGLE
JAVA PROGRAM FOR RIGHT ANGLE TRIANGLE
JAVA PROGRAM FOR SORTING OF ARRAY MINIMUM TO MAXIMUM WITHOUT USING SORTING METHOD
Java Program for Sorting Of Array Maximum to Minimum WITHOUT USING SORTING METHOD
JAVA PROGRAM FOR TO PRINT PRIME NUMBERS
JAVA PROGRAM FOR FIZZBIZZ , FIZZ BIZZ TEST
Definition:
A prime number is a whole number greater than 1, whose only two whole-number factors are 1 and itself. The first few prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29.
package mobbiinfo.PrimeNumers;
import java.util.Scanner;
public class PrimeNumbers {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
System.out.println("enter range of prime Numbers");
int n=Integer.parseInt(sc.next());
int n1=Integer.parseInt(sc.next());
for(int i=n;i<n1;i++){
boolean isPrime=true;
for(int j=2;j<i;j++){
if(i%j==0){
isPrime=false;
}
}
if(isPrime){
System.out.print("\t"+i);
}
if(i%10==0)
{
System.out.println();
}
}
}
}
INTERVIEW QUESTION FOR JAVA
Java program for EMPLOYEE DETAILS
Java program for MULTIPLE THREADS ACCESSING ONE METHOD
Java program for SINGLE THREADS ACCESSING ONE METHOD
Java program for Strin Reverse
java Program for Twin Prime numbers
JAVA PROGRAM FOR EQUILATERAL TRIANGLE
JAVA PROGRAM FOR RIGHT ANGLE TRIANGLE
JAVA PROGRAM FOR SORTING OF ARRAY MINIMUM TO MAXIMUM WITHOUT USING SORTING METHOD
Java Program for Sorting Of Array Maximum to Minimum WITHOUT USING SORTING METHOD
JAVA PROGRAM FOR TO PRINT PRIME NUMBERS
JAVA PROGRAM FOR FIZZBIZZ , FIZZ BIZZ TEST
Comments
Post a Comment