C++ Program to Check Entered String is Palindrome or Not

Write a Program to Check Entered String is Palindrome or Not
- C++ Program to Print Armstrong Number from 1 – 500
- C++ Program to Show Number is Even or Odd Without Using Modulus Operator
- C++ Program & Algorithm Convert Celsius to Fahrenheit
- C++ Program to a Number is Prime or Not
- C++ Program to Find Volume of Cube, Cylinder – Constructor Overloading
Source Code
#include<iostream> #include<string.h> #include<conio.h> using namespace std; int main() { char s[10]; int i,n,m,flag=0; cout<<"enter a string: "; cin>>s; m=strlen(s); n=m-1; for(i=0;i<=m/2;i++,n--) { if(s[i]!=s[n]) { flag++; break; } } if (flag==0) cout<<endl<<s<<" string is palindrome"; else cout<<endl<<s<<" string is not palindrome"; getch(); }