Answered step by step
Verified Expert Solution
Question
1 Approved Answer
write a c++ program that: 1. (20 marks) Write a program that asks the user to enter two doubles and prints the sum, difference, product,
write a c++ program that:
1. (20 marks) Write a program that asks the user to enter two doubles and prints the sum, difference, product, and division of these numbers. If the second number that is entered by the user is zero, the program should print out a message that the Division can not be calculated. However, it prints the results for the other operations. Here are two examples of the execution of the program: ***************************************** Enter the first number: 15 Enter the second number: 4 ***************************************** The results are: 19 11 Sum: Difference: Product: Division: 60 3.75 ****************************************** ***************************************** Enter the first number: 10 Enter the second number: 0 ***************************************** The results are: 10 Sum: 10 Difference: Product: Division: can not be calculated because of the value 0 of the second number 4. (25 marks) You are asked to write a C++ program, which first calculates and prints out the sum of the digits of a number with at most 7 digits. Then it prints out all the divisors of the sum number that is calculated in the previous step. The output should look like this: Enter a number with at most 7-digits: 1259955 Sum of the digits of 1259955 is: 36 The divisors of 36 are as follows: 1 2 3 4 6 9 12 18 36Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started