Python Program to perform all Arithmetic Operation by Taking user Input
number1=int(input("Enter first value:"))
number2=int(input("Enter second number:"))
sum=number1+number2
print("The addition of two numbers is:",sum)
sub=number1-number2
print("The subtraction is:",sub)
mult=number1*number2
print("The multiplication is:",mult)
div=number1/number2
print("The division is:",div)
rem=number1%number2
print("The remainder of division is:",rem)
Output:
Enter first value:200
Enter second number:100
The addition of two numbers is: 300
The subtraction is: 100
The multiplication is: 20000
The division is: 2.0
The remainder of division is: 0
Another Way
number1=(input("Enter first value:"))
number2=(input("Enter second number:"))
sum=int(number1)+int(number2)
print("The addition of two numbers is:",sum)
sub=int(number1)-int(number2)
print("The subtraction is:",sub)
mult=int(number1)*int(number2)
print("The multiplication is:",mult)
div=int(number1)/int(number2)
print("The division is:",div)
rem=int(number1)%int(number2)
print("The remainder of division is:",rem)
Output:
Enter first value:200
Enter second number:100
The addition of two numbers is: 300
The subtraction is: 100
The multiplication is: 20000
The division is: 2.0
The remainder of division is: 0
0 टिप्पण्या
कृपया तुमच्या प्रियजनांना लेख शेअर करा आणि तुमचा अभिप्राय जरूर नोंदवा. 🙏 🙏