write the program in c language to show word is palindrome or not.
Answers
Answered by
0
#include <stdio.h>
#include <string.h>
int main()
{
char a[100], b[100];
printf("Enter the string to check if it is a palindrome\n");
gets(a);
strcpy(b,a); strrev(b);
if (strcmp(a,b) == 0)
printf("Entered string is a palindrome.\n");
else
printf("Entered string is not a palindrome.\n");
return 0; }
output
madam
#include <string.h>
int main()
{
char a[100], b[100];
printf("Enter the string to check if it is a palindrome\n");
gets(a);
strcpy(b,a); strrev(b);
if (strcmp(a,b) == 0)
printf("Entered string is a palindrome.\n");
else
printf("Entered string is not a palindrome.\n");
return 0; }
output
madam
Similar questions
Science,
8 months ago
Social Sciences,
8 months ago
English,
8 months ago
Biology,
1 year ago
World Languages,
1 year ago