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
Irina18 [472]
3 years ago
6

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:57the function returns:7Ex: If the inputs are:-8-2the function returns:-8
Computers and Technology
1 answer:
storchak [24]3 years ago
4 0

I wrote my code in python 3.8:

def max_magnitude(num1, num2):

   return num1 if abs(num1) > abs(num2) else num2

print(max_magnitude(-8,-2))

I hope this helps!

You might be interested in
Write an if/else statement that compares the variable age with 65, adds 1 to the variable seniorCitizens if age is greater than
Oduvanchick [21]

if age >= 65:

seniorCitizens = seniorCitizens + 1

else:

nonSeniors = nonSeniors + 1

6 0
3 years ago
Whats a good slogan for digital citizenship
statuscvo [17]

Answer:

your brain is like a phone call it the cloud

Explanation:

5 0
3 years ago
Write c++ program to find maximum number for three variables using statement ?
Anastaziya [24]
The variable 10 ~ 810 would equal off to 10 leaving 40 left over..
5 0
3 years ago
Read 2 more answers
The best definition of an idiom is ___________________.
ddd [48]

[] Answer []

A phrase containing figurative language in which the word expresses a different idea from its exact meaning

[] Explanation \ Reasoning []

Idiom Example: "Break A Leg"

This is an idiom because it is figurative language that doesn't exactly mean what it says. The person saying "Break a leg" just means do really good that you'll "break a leg". In reality, we don't actually want you to break a leg. We just mean it figuratively.

<> Eclipsed <>

6 0
3 years ago
Read 2 more answers
Write a program in Arduino IDE by using C++ and upload in EDVINO, creat two variables x and y. Intialize them with some value.Pr
Kryger [21]

Answer:

There's no clearly defined answer. Just follow the code I've written. I'm not fluent in C++, much more of JS or C#, but just follow this, hopefully you understand and you do your own homework next time.

Explanation:

int x, y; //defines variables

char name;

cout << "Type a number: ";

cin >> x;

cout << "Type another number: ";

cin >> y;

cout<< "Whats your name?";

cin>>name;

If(x>y){

cout<<name;

}else{

cout<<"Exit";

}

4 0
3 years ago
Other questions:
  • What feature did we use to quickly apply the formatting shown in this image?
    9·1 answer
  • After a worksheet has been displayed in page layout view, page breaks are indicated by ________ in normal view.
    14·1 answer
  • We see color because an object that has light striking it
    7·1 answer
  • Which hypervisor works on older pcs without hardware virtualization support?
    9·2 answers
  • Is the percentage of the original sample that successfully completed a survey.
    10·1 answer
  • 24. The central processing unit (CPU) consists of two parts which are a. the input and output devices b. the control unit and th
    13·1 answer
  • Advantages of bursaries??????
    11·1 answer
  • You are having trouble cleaning your computer for a troublesome virus. you decide to try to clean your computer while in safe mo
    5·1 answer
  • When making an assembly of design what command is most.commonly used?
    15·1 answer
  • Plz answer me will mark as brainliest ​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!