Computer Science, asked by kritikamesh, 4 months ago

write a program in java to print non prime numbers​

Answers

Answered by sksajed805
0

I haven't know the answer . so please give me the point kindly

Answered by aarti225566
0

Explanation:

In this java program, we will take a number variable and check whether the number is prime or not.

  1. public class PrimeExample{
  2. public static void main(String args[]){
  3. int i,m=0,flag=0;
  4. int n=3;//it is the number to be checked.
  5. m=n/2;
  6. if(n==0||n==1){
  7. System.out.println(n+" is not prime number");
  8. }else{
Similar questions