- Write A C Program That Inputs A 5 Digits Positive Integer A 1 Make Sure That The Integer Is Made Of Exactly 5 Digit 1 (39.45 KiB) Viewed 22 times
Write a C++ program that inputs a 5-digits' positive integer A. 1) Make sure that the integer is made of exactly 5 digit
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Write a C++ program that inputs a 5-digits' positive integer A. 1) Make sure that the integer is made of exactly 5 digit
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)