Advertisement
S_h_u_v_r_o

Palindrome

Dec 9th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5. int a,b,c,d,e=0;
  6. char x[100],y[100];
  7. scanf("%[^\n]s",x);
  8. a=strlen(x);
  9. y[a]='\0';
  10. c=a-1;
  11. for(b=0; b<a; b++)
  12. {
  13. y[c]=x[b];
  14. c--;
  15.  
  16. }
  17. printf("%s\n",y);
  18. for(b=0; b<a; b++)
  19. {
  20. if(y[b]!=x[b])
  21. {
  22. e++;
  23. }
  24. }
  25. if(e>0)
  26. {
  27. printf("Not Palindrome");
  28. }
  29. else
  30. {
  31. printf("Palindrome\n");
  32. }
  33.  
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement