You can also download text file of this code here: Palindrome.txt
Java Code:
int num = Integer.parseInt(txt1.getText()); int n; n = num; int rev = 0; while (num!=0) { int r = num%10; num = num/10; rev = rev*10+r; } if (n==rev) { JOptionPane.showMessageDialog(null, "It Is a Palindrome"); } else { JOptionPane.showMessageDialog(null, "It Is Not A Palindrome"); } [Find More Java Code at www.sumikuma.tk
Comments
Post a Comment