subject

Subtraction + Decision and Loop This is a twist on the previous exercise that will help you review loops and decision structures. You will again ask the user to enter two numbers. However, you will ALWAYS subtract the smaller number from the larger number to ensure that you never get a negative number for an answer. You do this by checking the numbers and switching them if they are not in the right order (larger then smaller). All of this checking, switching, subtracting, and output of the answer should occur in a function.
((( THIS WAS THE PREVIOUS EXERCISE
Function Basics - Arguments and Parameters
This is another easy exercise to test your knowledge of the fundamentals. In main(), ask the user to enter two integers. Pass those two integers to a function that will subtract one number from another. This function must also output the answer to the user.
Output:
Enter two integers (separated by a space) and this program will subtract them: [user enters: 5 7]
5 - 7 = -2
Notes and Hints:
1) From now on, you must use a function prototype for all programs that use functions. Don't expect me to ask for it in each exercise. )))
Finally, ask the user if they would like to run the program again. By now, you should know exactly what type of loop to use.
Output:
Enter two integers (separated by a space) and this program will subtract the smaller from the larger: [user enters: 7 5]
7 - 5 = 2
Do you want to run this program again? [user enters: y]
Enter two integers (separated by a space) and this program will subtract the smaller from the larger: [user enters: 5 7]
7 - 5 = 2
Do you want to run this program again? [user enters: n]
Notes and Hints:
1) As always, make sure you accept an upper or lower case 'Y'

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:30
List the five on-board vehicle subsystems
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place?
Answers: 1
question
Computers and Technology, 24.06.2019 13:00
Refer to the figure and match the theorem that supports the statement.1.if chords are =, then arcs are =.if bc = de, then arc bc = arc de2.if arcs are =, then chords are =.if arc bc = arc de, then bc = de3.diameters perpen
Answers: 3
question
Computers and Technology, 24.06.2019 16:30
Which program can damage your computer?
Answers: 1
You know the right answer?
Subtraction + Decision and Loop This is a twist on the previous exercise that will help you review...
Questions
question
Mathematics, 24.03.2021 06:40
question
Mathematics, 24.03.2021 06:40
question
Mathematics, 24.03.2021 06:40
question
Mathematics, 24.03.2021 06:40
question
English, 24.03.2021 06:40
Questions on the website: 13722367