डाउनलोड पी.डी.एफ. ई-बुक्स
C - Palindrome Number

विवरण :

कोई विवरण नहीं है |


सोर्स कोड :

#include<stdio.h>
#include<conio.h>

void main() {
int num1, num2, remainder, reverse = 0;

printf("Enter any number: ");
scanf("%d", &num1);

num2 = num1;
while (num1 != 0){
remainder = num1 % 10;
num1 = num1 / 10;
reverse = reverse * 10 + remainder;
}

if (num2 == reverse){
printf("Entered Number is palindromic number .");
}
else{
printf("Entered Number is Not palindromic number .");
}

getch();
}

आउटपुट :

Enter any number: 454
Entered Number is palindromic number .