1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
mixer [17]
3 years ago
15

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
1 answer:
JulsSmile [24]3 years ago
5 0

Answer:

def max_magnitude(user_val1, user_val2):

if abs(user_val1) > abs(user_val2):

return user_val1

else:

return user_val2

if __name__ == '__main__':

n1 = int(input("Enter the first integer number: "))

n2 = int(input("Enter the second integer number: "))

print("The largest magnitude value of", n1, "and", n2, "is", max_magnitude(n1, n2))

Explanation:

You might be interested in
Q. 2. What will be the output of the following code?<br> //printf("Hello\n");<br> printf("Girls");
loris [4]

Answer:

Just two outputs \n a line break so:

Hello

Girls

4 0
3 years ago
In an array, the element is ______________________________. group of answer choices all of the data stored in the array the loca
miss Akunina [59]

Answer:

An individual piece of data stored in the array

Explanation:

7 0
3 years ago
WILL MARK BRAINLIEST Question #2
KiRa [710]

Answer:

correct[3]

Explanation:

Required

Which expression points to the u in "cloud"

First, it should be noted that "cloud" is a string and as such, the first element is represented as index 0, the next as index 1, etc.

Using the above as a guide, the u is as index 3

To access the elements of a string, we use: stringname[index]

In this case, the string name is correct.

<em>Hence, the correct statement is: correct[3]</em>

5 0
3 years ago
Who invented Computer? Answer Differently​
FinnZ [79.3K]

Answer:

Charles Babbage, an English mechanical engineer and polymath, originated the concept of a programmable computer. He is considered the "father of the computer". He invented the first mechanical computer in the early 19th century.

Explanation:

plz make me as a brainliest frd

8 0
3 years ago
Read 2 more answers
How did the ENIAC change computing?<br> how did the eniac change computing
WINSTONCH [101]

Answer:

It changed computing, because that was the first computer, and it was programmed by a woman

Explanation:

5 0
3 years ago
Other questions:
  • Can i uninstall adobe lightroom 6 and reinstall
    13·1 answer
  • Who made the Apple company?
    9·2 answers
  • Signals can be transmitted in one of two ways. list and explain both
    14·1 answer
  • Which of the following items is an example of software? A. WORD PROCESSING PROGRAM B. KEYBOARD C. PRINTER D. MOUSE
    7·1 answer
  • If an individual receives 1.8 mGy while standing 4 ft from a source of radiation for 2 minutes, which of the following option(s)
    9·1 answer
  • You are the network adminstrator for your company your network consists of two active directory domains research.westsim.local a
    12·1 answer
  • Write the definition of a class WeatherForecast that provides the following behavior (methods): A method called set_skies that h
    13·1 answer
  • What are some ways to rename a worksheet? Check all that apply.
    9·1 answer
  • FREEEEEEEEEEEEE FREEEEEEEEEEEEE Pointttssss​
    6·2 answers
  • He was called "The father of computing c_______ B_______​
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!