Python program to enter two numbers and perform all arithmetic operations
In this article, you will learn how to perform all arithmetic operations of two integer numbers in the python programming language.
You should have the knowledge of the following topics in python programming to understand this program.
- Python Arithmetic operators
There we will perform these arithmetic operations like Sum, Difference, Multiplication, Division, and Modulus.
# Python program to enter two numbers and perform all arithmetic operations print("Enter any two positive integer numbers:") p, q = int(input()), int(input()) sum, sub, mul, mod, div = 0, 0, 0, 0, 0 sum = p + q sub = p - q mul = p * q div = p / q mod = p % q print("\n") print("SUM ", p, " + ", q, " = ", sum) print("DIFFERENCE ", p, " - ", q, " = ", sub) print("PRODUCT ", p, " * ", q, " = ", mul) print("QUOTIENT ", p, " / ", q, " = ", div) print("MODULUS ", p, " % ", q, " = ", mod)
In this given program, we have taken inputs
12 from the user then we applied arithmetic operations on these integer numbers.
Then this will be returned the output values of this program.