GRAND ASSIGNMENT - 1 Finding Difference

 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.
Sample Input 1
200
500
Sample Output 1
300
Sample Input 2
-12
-1
Sample Output 2
11




number_1=int(input())

number_2=int(input())

if number_1>number_2:

       difference= (number_1 - number_2)
else:
       difference= (number_2 - number_1)

print(difference)



Comments

Popular posts from this blog

CODING ASSIGNMENT 3 Library Management

CODING PRACTICE 11 Music Page

CCBP Static Website Coding Assignment 2 Solution | Yoga Page