![]() loop until remaining number is not equal to 0 Printf("Enter a number to check if it is a palindrome or not\n") temp variable actas as a helper, used for reversing a number initialize 3 variable n= original, reversedNumber= number after reversing it Program to check is a number is palindrome in C #include If both are equal number is palindrome otherwise it is not a palindrome number.Check the reversed number with the original one. ![]() Reverse the number using temporary variable in while loop (take each digit from the beginning from end of a number to start, example for "12234" we will start checking "4" first then 3 and then 2
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |