hey guys! i am new to c++ and i need help with the following code. we are suppose to write a program and check if a word is palindrome or not.
#include <iostream>
using namespace std;
int IsPalindrome(int []);
void main()
{
char word[25];
cout <<" Enter a word: ";
cin>> word;
if (IsPalindrome(word)==1)
cout<<" Is a palindrome ";
else
cout<<" Is not a palindrome "
<<"\n";
system("pause");
}
int IsPalindrome(char str1 [])
{
int i,counter=0;
for(i=0; str1[i]!='\0'; i++);
for(i--; i>=0; i--)
if (str1[i-1]==str1[i])
counter++;
return counter;
}