write a program to input a word and check whether it is palindrome or not
PLZZ SEND IT GUYS
Answers
Answered by
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.
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
Similar questions