Write a Program to Subtract Two Numbers

In this tutorial, we are shown the program to subtract Two Number

How to Write a Program to Subtract Two Numbers

Here is The Example to subtract the two numbers.

num1 = 258
num2 = 125
sub = num1 - num2
print('The Result of subtracting {0} from {1} = {2}'.format(num2,num1,sub))

This program example accepts two integer values and subtracts one number from the other.

Please Enter the First Number: 22
Please Enter the second number: 44
The sum of 22 and 44 is 66.0

 

 

 

Leave a Comment

Verified by MonsterInsights