Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static bool isPalindrome(int num)
- {
- bool isPal = true;
- string s = num.ToString();
- for (int i = 0; i < s.Length/2; i++)
- {
- if (s[i] != s[s.Length - 1 - i])
- {
- isPal = false;
- break;
- }
- }
- return isPal;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement