#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("String is a palindrome"); Â } Â else { Â printf("String is not a palindrome"); Â } Â return 0; }
Team Answered question April 13, 2024