Write a python program to perform basic Arithmetic Operations

Tech Programmer
0

WRITE A PYTHON PROGRAM TO PERFORM BASIC ARITHMETIC OPERATIONS.


CODE FOR THE ABOVE  PYTHON  PROGRAM :



a = int(input(" ENTER THE FIRST NUMBER  : "))
b = int(input(" ENTER THE SECOND NUMBER : "))
print(" YOUR CHOICES ARE 1.ADD,2.MULTIPLY,3.SUBTRACTION,4.DIVISION,5.MODULES,6.EXIT")
c = int(input(" INPUT YOUR CHOICE NUMBER : "))
if(c==1):
    print(" THE ADDITION IS ",a+b)
elif(c==2):
    print(" THE MULTIPLICATION IS",a*b)
elif(c==3):
    print(" THE SUBTRACTION IS",a-b)
elif(c==4):
    print(" THE DIVISION IS",a/b)
elif(c==5):
    print(" THE REMAINDER IS",a%b)
else:
    pass


WRITTEN CODE FOR THE ABOVE PROGRAM :


a = int(input(" ENTER THE FIRST NUMBER  : "))

b = int(input(" ENTER THE SECOND NUMBER : "))

print(" YOUR CHOICES ARE 1.ADD,2.MULTIPLY, 3.SUBTRACTION, 4.DIVISION, 5.MODULES, 6.EXIT")

c = int(input(" INPUT YOUR CHOICE NUMBER : "))

if(c==1):

    print(" THE ADDITION IS ",a+b)

elif(c==2):

    print(" THE MULTIPLICATION IS",a*b)

elif(c==3):

    print(" THE SUBTRACTION IS",a-b)

elif(c==4):

    print(" THE DIVISION IS",a/b)

elif(c==5):

    print(" THE REMAINDER IS",a%b)

else:

    pass


OUTPUT :



Post a Comment

0Comments
Post a Comment (0)

Featured Highlighted Categories

You'll discover all of the most up-to-date bring innovative here.

Python List theory with List Programs
Get complete python lists theory and list basic and insane programs for your practice.
CBSE SAMPLE PAPERS
Get CBSE sample and question papers of last 7 years with answers to get best practice for your Board Exams
Python String theory and String Programs
Python strings complete theory with illustrations and practice programs for free