Question #174550

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


Expert's answer

print ('Enter first number: ')
first = input()
print ('Enter second number: ')
second = input()
print ('Absolute difference is: ')
if (int(first) - int(second)) > 0:
    print(int(first)-int(second))
else:
    print(int(second) - int(first))
LATEST TUTORIALS
APPROVED BY CLIENTS