"KEEP LEARNING, DON'T STOP."
"KEEP LEARNING, DON'T STOP."
In this section you will learn how to make palindrome string program in c++.
A palindrome is a string such that if you reverse it, it will not change. The string will be remain same and meaning also remain same.
Mom, Malayalam, Wow, Deleveled, etc.
#include<iostream.h> #include<conio.h> //PALINDROME NUMBER PROGRAM void main() { char *a; int i,len,flag=0; clrscr(); cout<<"\nENTER A STRING:- "; cin>>c; len=strlen(a); for (i=0; i<len; i++) { if(a[i]==a[len-i-1]) { flag=flag+1; } } if(flag==len) { cout<<"\nTHE STRING IS PALINDROM."; } else { cout<<"\nTHE STRING IS NOT PALINDROM."; } getch(); }
ENTER A STRING:- MAM THE STRING IS PALINDROM.