0 votes
163 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 125 views
0 votes
0 answers 73 views
0 votes
1 answer 148 views
0 votes
1 answer 165 views
0 votes
1 answer 128 views
0 votes
1 answer 148 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

561 users

...