Python
Python program using Assignment Operator
11 May
1
Write a program (WAP) in PYTHON to read two numbers from keyboard(User Input) and perform addition, subtraction, multiplication and division using assignment operator.
num1 = int(input('Enter First number: '))
num2 = int(input('Enter Second number '))
sum = num1 + num2
sub = num1 - num2
mul = num1 * num2
div = num1 / num2
floor_div = num1 // num2
print('Addition of ', num1, 'and', num2, 'is :', sum)
print('Subtraction of ', num1, 'and', num2, 'is :', sub)
print('Multiplication of ', num1, 'and', num2, 'is :', mul)
print('Division of ', num1, 'and', num2, 'is :', div)
print('Floor Division of ', num1, 'and', num2, 'is :', floor_div)
Try it Yourself ➠
Must Read :-
Previous article
Next article
Thank You :)
ReplyDelete