Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int isPalindrome(char *str, int len)
- {
- int i = 0, j = len -1;
- while (i <= j)
- {
- if (str[i] == ' ')
- {
- i++;
- continue;
- }
- if (str[j] == ' ')
- {
- j--;
- continue;
- }
- if (str[i] != str[j]) return 0;
- i++;
- j--;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement