Addition (+)
Substraction (-)
Multiplication (*)
Division (/)(//)
Modulus (%)
Input :
first num 20
second num 10Output :
Addition is 30
substraction is 10
multiplication is 200
float division 2.0
integer division 2
remainder is 0
PROGRAM IN PYTHON
num1=int(input("first num "))
num2=int(input("second num "))
#sum of two numbers
sum_of_two = num1 + num2
print("Addition is ",sum_of_two)
#substitution of two
sub_of_two = num1 - num2
print("substitution is ",sub_of_two)
#multiplication of two nums
sub_of_two = num1 * num2
print("multiplicatio is ",sub_of_two )
#division of two nums
div_of_two1 = num1 / num2 #float division
div_of_two2 = num1 // num2 #integer division
print("float division ",div_of_two1)
print("integer division ",div_of_two2)
#modulus of two
mod_of_two = num1 % num2
print("remainder is ",mod_of_two)
output IN PYTHON
first num 20
second num 10
Addition is 30
substitution is 10
multiplicatio is 200
float division 2.0
integer division 2
remainder is 0
>
Comments
Post a Comment
Type Your Comments !
Please do not enter any spam link in the comment box.