Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdbool.h>
- main(){
- int n=10,i=0;
- bool pal = false;
- char word[n];
- printf("Enter the word"); scanf("%s",word); int size=strlen(word) ;
- for(i=0;i<size/2;i++)
- if(word[i] == word[size- i] ) pal = true;
- if(pal == true) printf("the word is a palindrome");
- else printf("it is not a palindrome ");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement