write a java program which accept a number from user and check whether its prime or not.
Answers
Answered by
0
Answer:
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:
Similar questions
English,
2 months ago
Math,
2 months ago
Political Science,
5 months ago
Math,
5 months ago
English,
11 months ago