Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int check_odd_palindrome(int a[], int n){
- if(n<=1)
- return 1;
- if (a[0]%2==0 && a[n-1]%2==0)
- return check_odd_palindrome(a+1, n-2);
- else if (a[0]%2==0 && a[n-1]%2!=0)
- return check_odd_palindrome(a+1, n-1);
- else if (a[0]%2!=0 && a[n-1]%2==0)
- return check_odd_palindrome(a, n-1);
- else { // if both odd//
- if(a[0]==a[n-1])
- return check_odd_palindrome(a+1, n-2);
- else return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement