Computer Science, asked by Sirshak, 1 year ago

write a program to input a word and check whether it is palindrome or not
PLZZ SEND IT GUYS

Answers

Answered by Aruyadav
1
very easy
Today i had my computer half yearly exam
it was very tough.
ok i will give you answer...


import java.util.*;
public class Palindrome
{
public static void main()
{

Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int num=n;
while(num>0)
{
d=num%10;
r=r*10+d;
n=n/10
}
if(r==n)
System.out.println("Palindrome");
else
System.out.println("Not Palindrome");
}
}
//Mark it as brainliest.

Aruyadav: welxome
Aruyadav: welcome
Aruyadav: ok
Aruyadav: it will come when another person also answers the question
Similar questions