Guest User

Untitled

a guest
Feb 6th, 2016
203
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int check_odd_palindrome(int a[], int n){
  2.     if(n<=1)
  3.         return 1;
  4.     if (a[0]%2==0 && a[n-1]%2==0)
  5.         return check_odd_palindrome(a+1, n-2);
  6.     else if (a[0]%2==0 && a[n-1]%2!=0)
  7.         return check_odd_palindrome(a+1, n-1);
  8.     else if (a[0]%2!=0 && a[n-1]%2==0)
  9.         return check_odd_palindrome(a, n-1);
  10.     else { // if both odd//
  11.        if(a[0]==a[n-1])
  12.              return check_odd_palindrome(a+1, n-2);
  13.         else return 0;
  14.     }
  15. }
RAW Paste Data