Saturday, September 12, 2020

387 - python program to find sum and product of two numbers

 387 - python program to find sum and product of two numbers


 

python program to find sum and product of two numbers

================================================

 

Code :

# find sum and product of two numbers

x = int(input('Enter first number:'))

y = int(input('Enter second number:'))

#display sum

print('The sum of {0} and {1} is {2}'.format(x,y,x+y))

#display product

print('The product of {0} and {1} and {2}'.format(x,y,x*y))

#display both sum and product

print('the sum of {0} and {1} is {2} and product of {0} and {1} is {3}'.format(x,y,x+y,x*y))

 

Output :

Enter first number:11
Enter second number:22
The sum of 11 and 22 is 33
The product of 11 and 22 and 242
the sum of 11 and 22 is 33 and product of 11 and 22 is 242

 

 

 

 

 


No comments:

Post a Comment

Durga Puja in Odisha

 Durga Puja in Odisha