Java program to check for prime number
Answers
Answered by
5
Answer:
In this java program, we will take a number variable and check whether the number is prime or not.
public class PrimeExample{
public static void main(String args[]){
int i,m=0,flag=0;
int n=3;//it is the number to be checked.
m=n/2;
if(n==0||n==1){
System.out.println(n+" is not prime number");
}else{
Explanation:
mark as brainliest
Answered by
1
Explanation:
public class PrimeExample{
public static void main(String args[]){
int i,m=0,flag=0;
int n=3;//it is the number to be checked.
m=n/2;
if(n==0||n==1){
System.out.println(n+" is not prime number");
}else{
please mark as brainliest
Similar questions