Skip to main content

Featured

functions in Python

C++ program to check a palindrome string

//C++ program to check a palindrome string

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int i,j,flag=0;
char string[20];
cout<<"Enter A String\n";
cin>>string;
for(i=0;string[i]!='\0';i++);
for(j=0,--i;i>=0;--i,++j)
{
if(string[i]!=string[j])
{
flag=1;
break;
}
}
if(flag)
cout<<"Not a palindrome string";
else
cout<<"Palindrome String"; 
getch();
}


OUTPUT:



Comments

Popular Posts