Skip to content
doubtly

1 answer

Best answer

#include<stdio.h>
    #include<conio.h>
    #include<string.h>
    int main(){
        char str[20];
        int i, len, temp=0;
        int flag = 0;
        printf("Enter a string:");
        scanf("%s", str);
        len = strlen(str);
        for(i=0;i < len ;i++){
            if(str[i] != str[len-i-1]){
                temp = 1;
            break;
       }
    }

if(temp==0)
printf("\n Given string is palindrome");
else 
printf("\n Not palindrome");
}
Doubtly · 20 Jul 2022 Report
Was this answer helpful?

Your answer

Log in or create a free account to answer this question.