Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

1.program to add two no.

#this program adds two numbers

num1=38 nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
num2= 22

#Add two numbers

sum= num1+num2

#display the sum


print (sum )

<<< 60

2.program to add three numbers

#store input numbers

a=input ( ‘ enter first number:’ )


b=input (‘ enter second number:’)
c=input (‘ enter second number:’)

#add three numbers

sum= float(a) + float(b) + float(c)

#Display the sum


print(sum)

Nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn3.
program to multiply three numbers.
#program to multiply three numbers

a=3
b=2
c=2

#calculate product

a*b*c

#print multiplication value


print(product)

<<<12

4. program to find the Average of Three Numbers.

#program to find average of three numbers

# take inputs

X=2
y=3
z=4

#calculate average
(x+y+z)/3

Print result

Print (average)

<<<3
Nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
5.program to find area and perimeter of rectangle

Length=3
breadth=6
area=18
Perimeter=18

1. 6. program that asks a user to input their name, class and


print the result.
Enter name of the student : tapasvi
Enter class of the student : 9
Enter age of the student : 14
name:tapasvi Class:9 Age:14

Name: tapasvi
Class: 9
Age:14
7.program to divide two numbers

Enter the first number : 6


Enter the second number :2

<<<3

You might also like