Write a program in java to find the minimum prime digit in a number.
Answers
Answered by
0
Answer:
kugh nahi
Explanation:
This java program check number is prime or not. Remember that smallest prime number is 2.
import java.util.Scanner;
/**
*
* @author Mindclues
*/
public class Primeno {
public static void main(String[] args) {
int n;
String result = "";
System.out.println("Enter a number --");
Scanner sc = new Scanner(System.in);
n = sc.nextInt();
for (int i = 2; i < n; i++) {
if (0 == n % i) {
result = "It's not a prime number.";
break;
} else {
result = "It's a prime number.";
}
}
System.out.println
Similar questions