1:56 PM
C++ Program of STRING PALINDROME

Write a Program of STRING PALINDROME

#include<iostream.h> 
#include<conio.h> 
 
#include"string.h"
void main()
{
char *str,*rev;
int i,j;
clrscr();
printf("\nEnter a string:");
scanf("%s",str);
for(i=strlen(str)-1,j=0;i>=0;i--,j++)
rev[j]=str[i];
rev[j]='\0';
if(strcmp(rev,str))
printf("\nThe string is not a palindrome");
else
printf("\nThe string is a palindrome");
getch();
}
 
 
 
 
 
Note:
      If you want to change in this program please write through the comment on this page. you can also past similar program 
                 of c++ with output.your comment is valuable to the other user and person.
 
Views: 100 | Added by: vijoriya | Tags: program, String, Palindrome, c++ | Rating: 0.0/0
Total comments: 0
avatar