A. Write a value‐returning function called length() that takes a positive integer and
returns the number of digits in that integer.

B. Using the written function in part A, write a value‐returning function called ispalindrome(),
while 5675 is not palindrome. The function takes a positive integer and
returns true if the integer is a palindrome and false otherwise.
Test your functions by writing a main function that prompts the user to input an integer
and outputs its number of digits and "It Is a Palindrome" message if it is a palindrome,
otherwise "It Is not a Palindrome".

3 Years
Discussion Span
Last Post by jencas

What NathanOliver said, plus we aren't here to help you cheat on your homework assignments. Make an honest effort to solve the problem, post your work here, and we will make appropriate comments.


As NathanOliver and rubberman said, at least post your source code here. We need to see a bit of effort before we provide assistance.


Do your best and attempt each question. It's only when you encounter an issue that we can be of further assistance.
Moreover, there is plenty of resources around around daniweb. Search around and take bits and pieces and stick them together ;)

Edited by julesmikey


Use two std:string and initalize them both with the word. Use std::reverse() on the second string. If both strings are same after that, the word is a palindrome

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.