Computer Science, asked by aritrakayal29, 4 months ago

Write a program to accept a number and check whether the

number is palindrome or not.

( A number is said to be palindrome if the new number obtained

after reversing the digits is same as the original number.)

Sample Input: 343

Sample output : 343 is a palindrome number. in java

type accurately I have to type in computer ​

Answers

Answered by CoderRishav
2

Answer:

import java.util.Scanner;

class Pall

{

public static void main()

{

Scanner in = new Scanner(System.in);

int num = in.nextInt();

int cpy = num;

int k, s = 0;

while (num != 0)

{

k = num % 10;

s = s * 10 + k;

num /= 10;

}

if (cpy == s) {

System.out.print("Pallendrome");

} else {

System.out.print("Not Pallendrome");

}

}

}

Answered by sahilkumar0142004
0

Explanation:

explanation on the picture

Attachments:
Similar questions