Write a C++ program that inputs a 5-digits' positive integer A. 1) Make sure that the integer is made of exactly 5 digit

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
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

Post by answerhappygod »

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
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 23 times
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)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply