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