Computer Science, asked by mishraamyaslg, 4 days ago

input a number in Java and print yes if the number is not prime but the last digit is prime​

Answers

Answered by mahi78972
0

Answer:

import java.util.*;

public class prime

{

public static void main(String args[])

{

Scanner ss=new Scanner(System.in);

int n=ss.nextInt();

int d=n%10;

if(d==2||d==3||d==5||d==7)

System.out.println(n);

}

}

Explanation:

Similar questions