Write a program in C++ to Check the string is palindrome or not.
#include<iostream.h>
#include<conio.h> void main() { char ch[10],ch1[10]; clrscr(); cout<<”Enter any name”; cin>>ch; strcpy(ch1,ch); strrev(ch1); if(strcmp(ch1,ch)==0) { cout<<”Palindrome”; } else { Cout<<”Not Palindrome ”; } getch(); } |
|