Que.2.
Program to accept two numbers and display addition , subtraction ,
multiplication ,division and modules .
Program : x=int(input(" Enter a number"))
y=int(input(" Enter a number"))
z=x+y
print("add",z)
z=x-y
print("sub",z)
z=x*
print("multiply",z)
z=x/y
print("divide",z)
z=x%y
print("modulus",z)
Output :
Que.3. Program to calculate factorial of given number.
Program : n=int(input("enter a no. "))
if n < 0:
print( "Factorial does not exist for negative numbers.")
elif n == 0:
Print("1")
else:
fact = 1
while n > 0:
fact *= n
n -= 1
print(" fact =", fact)
Output :