A palindromic number is a number that remains the same when its digits are reversed.The term palindromic is derived from palindrome, which refers to a word (such as rotor or racecar) whose spelling is unchanged when its letters are reversed.
For example:12321 is same when its digits are reversed.
C program to store information of n student using structure
C program to find the length of a string without strlen( ) function
C program to find the Armstrong Number between intervals
C program to check whether a certain number is Armstrong or not
C Program to display the Fibonacci Series up-to n number of terms
C Program to display the Fibonacci Series up-to a certain number
C program to find the factorial of a number
C Program to Find Prime Numbers Between Intervals Using Functions.
C program: perfect or not checking
C program to identify a number as even or odd
For example:12321 is same when its digits are reversed.
SOURCE CODE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | #include void main() { int num, i, reverse = 0, temp, rem; printf("Enter number: "); scanf("%d",&num); temp = num; while(num ! = 0) { rem = num % 10; num = num / 10; reverse=rem+(reverse*10); } if(reverse==temp) { printf(" Palindrome Number"); } else { printf("Not a Palindrome Number"); } getch(); } |
No comments:
Post a Comment