0% found this document useful (0 votes)
21 views3 pages

Class 01 - Arithmatic Operations

The document contains a Python program that takes two numbers as input and calculates the sum, difference, product, division, modulus, exponent, and floor division of the two numbers.

Uploaded by

Pranav Nair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views3 pages

Class 01 - Arithmatic Operations

The document contains a Python program that takes two numbers as input and calculates the sum, difference, product, division, modulus, exponent, and floor division of the two numbers.

Uploaded by

Pranav Nair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

CODE:

# PROGRAM TO SOLVE ARITHMATIC OPERATIONS

# INPUTTING VARIABLES
N1 = int(input("Enter first number"))
N2 = int(input('Enter second number'))

# CALCULATION
sumValue = N1 + N2
diffValue = N1 - N2
prodValue = N1 * N2
divValue = N1 / N2
modValue = N1 % N2
expValue = N1 ** N2
flrdiv = N1 // N2

# OUTPUT
print("ARITHMATIC OPERATIONS")
print("Sum of ", N1, " and ", N2, " is: \t", sumValue)
print("Diff of ", N1, " and ", N2, " is: \t", diffValue)
print("Product of ", N1, " and ", N2, " is: \t", prodValue)
print("Div of ", N1, " and ", N2, " is: \t", divValue)
print("Remainder of ", N1, " and ", N2, " is: \t", modValue)
print("Power of ", N1, " to ", N2, " is: \t", expValue)
print("Flr div of ", N1, " and ", N2, " is: \t", flrdiv)

OUTPUT
Enter first number
34
Enter second number
45
ARITHMATIC OPERATIONS
Sum of 34 and 45 is: 79
Diff of 34 and 45 is: -11
Product of 34 and 45 is: 1530
Div of 34 and 45 is: 0.7555555555555555
Remainder of 34 and 45 is: 34
Power of 34 to 45 is:
825184889837725994971915471173621692744697928074424045623
011467853824
Flr div of 34 and 45 is: 0

** Process exited - Return Code: 0 **


Press Enter to exit terminal

You might also like