0 votes
112 views
in C programming by (98.9k points)
edited
C programto check whether a word is palindrome or not..

1 Answer

0 votes
by (98.9k points)
selected by
 
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");
}

 

Related questions

0 votes
1 answer 103 views
0 votes
0 answers 65 views
0 votes
1 answer 130 views
0 votes
1 answer 146 views
0 votes
1 answer 105 views
0 votes
1 answer 116 views
asked Jul 20, 2022 in C programming by Doubtly (98.9k points)

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

535 users

...