Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Buss error
- Segment error (core dumped)
- Problem solved. But some times in runtime it shows the above errors, & sometimes it works fine. Didn't found the actual reason */
- #include<stdio.h>
- #include<math.h>
- int main()
- {
- int n, m=0,digit=log10(n), a[digit], count=0, r;
- scanf("%d", &n);
- while(n>0)
- {
- r=n%10;
- a[count]=r;
- n=n/10;
- count++;
- }
- int i;
- for(i=0; i<count; i++){
- if(a[i]==a[count-i-1])
- m++;
- }
- if (m==count)
- printf("Palindrome");
- else
- printf("Not palindrome");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement