Tuesday 29 November 2016

Perform Arithmetic Operation using Python.

#Assignment No : 1(A)
# Perform Arithmetic Operation using Python.

n1 = int(input("Enter first Number:"))  # string --> int
n2 = int(input("Enter Second Number:"))  # string --> int

n3 = n1+n2
n4 = n1-n2
n5 = n1*n2
n6 = float (n1)/n2
n7 = n1%n2

print "Addition of Two number is :",n3
print "Subtraction of Two number is :",n4
print "Multiplication of Two number is :",n5
print "Division of Two number is :",n6


Output :

Enter first Number:12
Enter Second Number:343
Addition of Two number is : 355
Subtraction of Two number is : -331
Multiplication of Two number is : 4116
Division of Two number is : 0.0349854227405







No comments:

Post a Comment