-1

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".

6
Contributors
5
Replies
33
Views
2 Years
Discussion Span
Last Post by jencas
0

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.

0

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

0

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

0

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.