Guest User

Untitled

a guest
Jul 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. static bool IsPolindrom(string num)
  2. {
  3. for (int i = 0, j = num.Length - 1; i <= j; i++, j--)
  4. if (num[i] != num[j])
  5. return false;
  6. return true;
  7. }
  8.  
  9. static string ToBinary(int num)
  10. {
  11. int x = (num % 2);
  12. num /= 2;
  13. if (num == 0)
  14. return x.ToString();
  15. return ToBinary(num) + x.ToString();
  16. }
Add Comment
Please, Sign In to add comment