Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main(){
- int flag,i=0,j,l;
- char x[100];
- scanf("%s",x);
- l=strlen(x);
- j=l-1;
- for(i=0;i<l/2;i++,j--){
- if(x[i]!=x[j]){
- flag=0;
- break;
- }
- }
- if (flag==0){
- printf("Not a Palindrome");
- }
- else{
- printf("Palindrome");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement