1: #include <stdio.h>
2: int main()
3: {
4: int n, reverse = 0, temp;
5: printf("Enter a number to check if it is a palindrome or not\n");
6: scanf("%d",&n);
7: temp = n;
8: while( temp != 0 )
9: {
10: reverse = reverse * 10;
11: reverse = reverse + temp%10;
12: temp = temp/10;
13: }
14: if ( n == reverse )
15: printf("%d is a palindrome number.\n", n);
16: else
17: printf("%d is not a palindrome number.\n", n);
18: return 0;
19: }
getsprogramming Tutorials , C Programming, CPP Programming and JAVA Programming , Python Programming , Javascript Programming Welcome to getsprogramming Blog Here You Find Different Programs in Easier way to Explain and gain Knowledge and Try Your Self..Thanks
Monday, 13 July 2015
Write C Program to Check Wheather Input Number is Palindram or not
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment