Advertisement
Md_hosen_zisad

palindome

Oct 15th, 2017
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int i,l,flag=1,j;
  5. char str[100];
  6. gets(str);
  7. l=strlen(str);
  8. for(i=0,j=l-1;i<l/2 ;i++,j--)
  9. {
  10. if(str[i]!=str[j])
  11. {flag=0;
  12. break ;}
  13. }
  14. if(flag==0)
  15. {
  16. printf("NOT Palindome ");}
  17. else{
  18. printf("Palindome");
  19. }
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement