Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class IsPalindrome
- {
- public static bool IsPalindromeInt(int x)
- {
- if (x < 0)
- return false;
- int[] a = new int[10];
- int temp = 0, b = 0;
- while (x > 0)
- {
- a[b] = x % 10;
- x = x / 10;
- b++;
- }
- temp = b;
- b--;
- for (int i =0;i< temp;i++)
- {
- if (a[i] != a[b])
- return false;
- b--;
- }
- return true ;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement