java program to check whether a number is pallindrome or not using recursion???????
Java check number is palindrome or not:
import java.util.Scanner; public class NumberPalindrome { public static boolean check(String s) { if(s.length() == 0 || s.length() == 1) return true; if(s.charAt(0) == s.charAt(s.length()-1)) return check(s.substring(1, s.length()-1)); return false; } public static void main(String[]args) { Scanner input = new Scanner(System.in); System.out.print("Enter Number to check: "); int num=input.nextInt(); String number = Integer.toString(num); if(check(number)) System.out.println(number + " is a palindrome"); else System.out.println(number + " is not a palindrome"); } }