WHAT'S NEW?
Loading...
Showing posts with label Palindrome. Show all posts
Showing posts with label Palindrome. Show all posts

/*Check if a phrase is Palindrome*/
#include<stdio.h>
#include<string.h>

void main() {
    char phr[50], phrs[50];
    int i, j;
    printf("\nEnter the phrase: ");
    gets(phr);
    i = strlen(phr);
    for (j = 0; j < i; j++) {
        phrs[j] = phr[i - 1 - j];
    }
    if (strcmpi(phr, phrs) == 0)
        printf("\nIt is a palindrome");
    else
        printf("\nIt is not a palindrome");
}