Question #231921

Finding Difference

Write a program to print the absolute difference between the two given numbers. (Absolute difference is the difference without the negative sign)Input


The first line of the input will be an integer N1.

The second line of the input will be an integer N2.Output


Print the absolute difference of the given two numbers.Explanation


For example, if the given N1 is 200 and N2 is 500

The difference in number is 200 - 500 = -300

The absolute difference is 300.


Expert's answer

n1 = int(input('First integer: '))
n2 = int(input('Second integer: '))
print('Absolute difference: ', abs(n1 - n2))
LATEST TUTORIALS
APPROVED BY CLIENTS