Anonymous

How To Write A Program To Check Whether A No Is Palindrome Or Not?

1

1 Answers

Alongbar Daimary Profile

Check  Palindrome


#include <iostream.h>
#include <string.h>

int main()
{

char str[100];
cout << "Enter a word to check :";
cin >> str;
int x = strlen(str)-1;
for(int I = 0; I <= x; I++)
{
if (str[I] == str[x-I])
{
continue;
}
else
{
cout<<"Not a palidrome"<<endl;
return 0;
}
}

cout << "Entered word is Polindrome"<<endl;
return 0;
}

Answer Question

Anonymous