Advertisement
YArt

Untitled

Aug 12th, 2014
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdbool.h>
  3. main(){
  4. int n=10,i=0;
  5. bool pal = false;
  6. char word[n];
  7. printf("Enter the word"); scanf("%s",word); int size=strlen(word) ;
  8. for(i=0;i<size/2;i++)
  9. if(word[i] == word[size- i] ) pal = true;
  10.  
  11. if(pal == true) printf("the word is a palindrome");
  12. else printf("it is not a palindrome ");
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement