write a palentrome program
Answers
Answered by
1
C program for palindrome number:
#include <stdio.h>
int main()
{
int n, r = 0, t;
printf("Enter a number to check if it is a palindrome or not\n");
scanf("%d", &n);
t = n;
while (t != 0).
Answered by
1
Explanation:
#include <stdio.h>
int main()
{
int n, b= 0, t;
printf("Enter a number\n");
scanf("%d", &n);
t = n;
while (t != 0)
{
r = r * 10;
r = r + t%10;
t = t/10;
}
if (n == b)
printf("%d is a palindrome number.\n", n);
else
printf("%d isn't a palindrome number.\n", n);
return 0;
}
Similar questions