Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
181 views
in Computer by (51.9k points)
closed by

Write a program to enter two integers and perform all arithmetic operations on them.

1 Answer

+1 vote
by (49.5k points)
selected by
 
Best answer
Program:

#Program to input two numbers and performing all arithmetic operations

#Input first number

num1 = int(input("Enter first number: "))

#Input Second number

num2 = int(input("Enter second number: "))

#Printing the result for all arithmetic operations

print("Results:-")

print("Addition: ",num1+num2)

print("Subtraction: ",num1-num2)

print("Multiplication: ",num1*num2)

print("Division: ",num1/num2)

print("Modulus: ", num1%num2)

print("Floor Division: ",num1//num2)

print("Exponentiation: ",num1 ** num2)

OUTPUT:

Enter first number: 8

Enter second number: 3

Results:-

Addition: 11

Subtraction: 5

Multiplication: 24

Division: 2.6666666666666665

Modulus: 2

Floor Division: 2

Exponentiation: 512

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...