-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharray_13.java
More file actions
29 lines (25 loc) · 523 Bytes
/
array_13.java
File metadata and controls
29 lines (25 loc) · 523 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//WAP to find given number is palimdromic prime or not.
public class array_13{
public static void main(String args[]){
int n=6;
int count=0, sum=0;
for(int i=1; i<=n; i++){
if(n%i == 0){
count++;
}
}
int temp = n;
while(temp!=0){
sum *= 10;
sum += temp%10;
temp/=10;
}
System.out.println(sum);
if(count == 2 && n == sum){
System.out.print(n+ " is palindromic prime");
}
else{
System.out.print(n+ " is not palindromic prime");
}
}
}