Answer:
The question is answered in python
def max_magnitude(a,b):
if abs(a) > abs(b):
return a
else:
return b
num1 = int(input("Num 1: "))
num2 = int(input("Num 2: "))
print(max_magnitude(num1,num2))
Step-by-step explanation:
This question is answered using the concept of absolute value to get the integer with the highest magnitude
First, the function is defined with integer parameters a and b
def max_magnitude(a,b):
This checks if a has the highest magnitude
if abs(a) > abs(b):
If true, it returns a
return a
If otherwise, it returns b
else:
return b
The main starts here
The next two lines prompt the user for inputs
num1 = int(input("Num 1: "))
num2 = int(input("Num 2: "))
This calls the function
print(max_magnitude(num1,num2))