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