68 774
Assignments Done
Successfully Done
In January 2019

Answer to Question #56990 in C for rajashree g.s

Question #56990
write a program to accept a string and find out if it is a palindrome
Expert's answer
#include <stdio.h>

int isPalindrome(char *str);

int main()
char str[100];
printf("Enter your string:");
scanf("%s", str);
if(isPalindrome(str) == 1)
printf("It is palindrome.\n");
printf("It is NOT palindrome.\n");

int isPalindrome(char *str)
int i, len = 0;
while (str[len] != '\0')
for(i = 0; i < len/2; i++)
if(str[i] != str[len - 1 - i])
return 0;
return 1;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions