Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- char isPalindromeInt(int a[], int n)
- {
- if (n == 0)
- {
- if (a[n] == a[0])
- isPalindromeInt(a + 1, n - 1);
- return 0;
- }
- return 1;
- }
- void main()
- {
- int n, a[20];
- scanf("%d", &n);
- for (int i = 0; i < 20; i++)
- scanf("%d", &a[i]);
- if (isPalindromeInt(a, n))
- printf("Palindrome");
- else
- printf("Not Palindrome");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement