Palindrome Number|Word Program in C
Palindrome number: On reversing a number if the reversed number is equal to the original number then the number is called Palindrome number.
Palindrome word: On reversing a word if the reversed word is equal to the original word then the word is called Palindrome word.
Example of palindrome numbers : 11, 22, 121, 111, 12321,etc.
Example of non palindrome numbers : 12, 27, 96, 123, 12312,etc.
Example of palindrome words: mam, dad, mom, madam, etc.
Algorithm:
Step 1: Accept a number/word from the user and store it in a variable say number/word.Step 2: Reverse the number and store it in another variable say 'reverse'.Step 3: Check if the number is equal to the 'reverse' then Display "The Given number is a Palindrome number"elseDisplay "The Given number is not a Palindrome number".
Sample Input/Output:
Sample Input 1:Enter number: 121Sample Output 1:The given number is a palindrome number
Sample Input 2:Enter number: 123Sample Output 2:The given number is not a palindrome number
Sample Input 2:
0 Comments