Answer to Question #256502 in UNIX/Linux Programming for Kar

Question #256502
Write a script to enter two numbers and do all arithmetic operations that (+,-,*,/,%)
1
Expert's answer
2021-10-29T01:49:40-0400
num1 = int(input('Enter First number: '))

num2 = int(input('Enter Second number '))

add = num1 + num2

dif = num1 - num2

mul = num1 * num2

div = num1 / num2

floor_div = num1 // num2

power = num1 ** num2

modulus = num1 % num2

print('Sum of ',num1 ,'and' ,num2 ,'is :',add)

print('Difference of ',num1 ,'and' ,num2 ,'is :',dif)

print('Product of' ,num1 ,'and' ,num2 ,'is :',mul)

print('Division of ',num1 ,'and' ,num2 ,'is :',div)

print('Floor Division of ',num1 ,'and' ,num2 ,'is :',floor_div)

print('Exponent of ',num1 ,'and' ,num2 ,'is :',power)

print('Modulus of ',num1 ,'and' ,num2 ,'is :',modulus)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS