-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJLB1.java
More file actions
29 lines (26 loc) · 757 Bytes
/
Copy pathJLB1.java
File metadata and controls
29 lines (26 loc) · 757 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
package Assignment1;
import java.util.Scanner;
public class JLB1 {
public static void main(String [] arg){
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int m = n;
int x = 0;
while(n > 0){
x = x * 10 + n % 10;
n = n / 10;
}
int sum = 0;
if(x == m){
while(x > 0){
n = x % 10;
x = x / 10;
if(n % 2 == 0) sum += n;
}
}
else
System.out.println(m + " is not palindrome");
if(sum > 25) System.out.println(m + " is palindrome and sum is more than 25");
else System.out.println(m + " is palindrome and sum is not more than 25");
}
}