Computer Science, asked by Anonymous, 7 months ago

can anyone write the program of palindrome​

Answers

Answered by Archika123
20

Answer:

#include <stdio.h>

int main() {

int n, reversedN = 0, remainder, originalN;

printf("Enter an integer: ");

scanf("%d", &n);

originalN = n;

// reversed integer is stored in reversedN

while (n != 0) {

remainder = n % 10;

reversedN = reversedN * 10 + remainder;

n /= 10;

}

// palindrome if orignalN and reversedN are equal

if (originalN == reversedN)

printf("%d is a palindrome.", originalN);

else

printf("%d is not a palindrome.", originalN);

return 0;

}

Output

Enter an integer: 1001

1001 is a palindrome.

Explanation:

hope this will help u

Plzzz mark me as BRAINLIEST ❤️❤️❤️

Answered by XxHeartKillerGirl9xX
1

Answer:

Palindrome number in c: A palindrome number is a number that is same after reverse. For example 121, 34543, 343, 131, 48984 are the palindrome numbers.

Similar questions