Anjeev Singh Academy

Anjeev Singh Academy

Python Program to enter two numbers and perform all arithmetic operations – arithmetic calculator

Python Program to enter two numbers and perform all arithmetic operations – arithmetic calculator

#########################################
# Language : Python
# Topic: Arithmetic Calculator
# Author : Anjeev Singh
#########################################

n = int(input("Enter Number 1: "))
m = int(input("Enter Number 2: "))

print("\nNumbers are ", n , "and", m)
print('-' * 20)

sum = n + m     # addition
print("Sum: ", sum)

diff = n - m    # subtraction
print("\nDifference: ", diff)

prod = n * m    # product
print("\nProduct: ", prod)

quo = n / m     # division
print("\nQuotient: ", quo)

intquo = n // m  #floor/integer division
print("\nInteger Quotient: ", intquo)

rem = n % m  #modulo/remainder 
print("\nRemainder : ", rem)

power = n ** m #exponentiation 
print("\n", n, "raised to power", m,": ", power)


Sorry! You cannot copy content of this page. Please contact, in case you want this content.

Scroll to Top