#include <stdio.h>
#include <string.h>
//***************BUG - spaces in string cause errors!!*******
//char st[]="amanaplanacanalpanama";
char st[] = "racecar";
//char st[] = "never odd or even";   
//char st[] = "computers r dumb";



char str_reverse(char arr[], int length){
  int i, pal_chk;
  char rev_st[length + 1];

  for (i =0; i < length; i++){
    if (arr[i] != '\0'){
      rev_st[length -1 - i] = arr[i];
    }
  }
    printf("Original string: %s\nReversed string: %s\n"
	   ,st, rev_st);
    
    if (0==strcmp(st, rev_st)){
      printf("Palindrome?: YES\n");
    }
    else{
      printf("Palindrome?: NO\n");
    }
  
}
  

int main(){
  str_reverse(st, strlen(st));
  

  return 0;

}

