Computer Science, asked by peterbhai, 1 year ago

a program in java for palindrome

Answers

Answered by ShivamSharma111
6
import java.util.*;
public class palindrome
{
public static void main()
{
Scanner sc=new Scanner(System.in);
int i,rev=0,n;
System.out.println("Enter number");
n=sc.nextInt();
for(1=n;i>0;i=i/10)
{
int c=n°/• 10;
rev=(rev*10)+c;
}
if(rev==n)
{
System.out.println("Palindrome number");
}
else
{
System.out.println("Not a palindrome number");
}
}
}
}

ShivamSharma111: this is the program that you need ..
peterbhai: you have taken n from user
ShivamSharma111: yupp
Similar questions