Write a function max_magnitude() with two integer input parameters that returns the largest magnitude value. Use the function in a program that takes two integer inputs, and outputs the largest magnitude value.
Ex: If the inputs are:
5 7
the function returns:
7
Ex: If the inputs are:
-8 -2
the function returns:
-8
Note: The function does not just return the largest value, which for -8 -2 would be -2. Though not necessary, you may use the absolute-value built-in math function.
Your program must define and call a function:
int MaxMagnitude(int userVal1, int userVal2)
code------------------------
#include
using namespace std;
/* Define your function here */
int main() {
/* Type your code here */
return 0;
}
Computers and Technology
Views: 0 Asked: 02-11 09:56:02
On this page you can find the answer to the question of the computers and technology category, and also ask your own question
Other questions in category
- Suppose that a particular algorithm has time complexity T(n) = 3 \times 2^nT(n)=3×2 n and that e...
- 1.Which of the serves as the basis for determining whether an object has moved or not?...
- One of the best places to get questions answered concerning company policy is from...
- How does communication increase engagement
- Drag the tiles to the correct boxes to complete the pairs.
- Which standardized framework was developed by NIST to be used as a guidance document designed to hel...
- Write a short note on Programmable register
- What Roblos game should I make, I am also a noob at making games by the way so what should I do that...
- What is a query? State it's uses.
- How many 2/8 pound patties can she make from 7/8 of a pound of hamburger...