Aim:
To check given string is palindrome or not.
Program:
#include<stdio.h>
#include<string.h>
#include<conio.h>
void main ()
{
char str[80],revstr[80];
clrscr ( );
printf("\nEnter a string:");
scanf("%s",&str)
strcpy(revstr,str);
strrev(revstr);
if(!strcmp(str,revstr))
printf("\nGiven string '%s' is Palindrome",str);
else
printf("\nGiven string '%s' is not Palindrome",str);
}
Output:
Enter a string: medem
Given string 'medem' is Palindrome
Your blog is very helpful and easy to learn my one request is; Please write C++ program to Check Number is Palindrome or not
ReplyDeleteYour blog is very helpful and easy to learn my one request is; Please write C++ program to Check Number is Palindrome or not
ReplyDelete