Computer Science, asked by Malikariz, 1 year ago

write a program to enter a number check whether it is palendrome or not ?

Answers

Answered by VemugantiRahul
1
#include <stdio.h>
int main()
{
int n, reversedInteger = 0, remainder, originalInteger;

printf("Enter an integer: ");
scanf("%d", &n);

originalInteger = n; // reversed integer is stored in variable
while( n!=0 )
{
remainder = n%10;
reversedInteger = reversedInteger*10 + remainder;
n /= 10;
}
// palindrome if orignalInteger and reversedInteger are equal

if (originalInteger == reversedInteger)
printf("%d is a palindrome.", originalInteger);
else
printf("%d is not a palindrome.", originalInteger);
return 0;
}

Output

Enter an integer: 1001 1001 is a palindrome.

Malikariz: this is not a java programming ......\
VemugantiRahul: It is in C
VemugantiRahul: You didn't mention specifically JAVA
Malikariz: yeah but i need java programming
Answered by santoshbhatt
0
hope it will help for u
if u like this mark as brainliest plz
Attachments:

Malikariz: it is not right/....
Similar questions