Write a C++ program that inputs a 5-digits' positive integer A. 1) Make sure that the integer is made of exactly 5 digit
Posted: Fri Jul 08, 2022 6:29 am
Write a C++ program that inputs a 5-digits' positive integer A. 1) Make sure that the integer is made of exactly 5 digits otherwise let your program keeps prompting the user to enter another one. (5 points) 2) Output if A is palindrome* or not. (10 points) 3) In case A is not palindrome output the 5 digits in reverse order separated by +++ (5 points). 4) Now, output the A-th harmonic** number. (10 points) Annex: *An integer is said to be palindrome: if when its digits are reversed, it stays the same. For example, 12321 is a palindrome, but 12345 is not. **The n-th harmonic number is equal to 1+(1/2)+(1/3)+(1/4)+...+(1/n)