Class-5 Computer Prog
Class-5 Computer Prog
CLASS – 5
**NOTE: - SIMILAR TYPE OF PROGRAMS WILL COME IN EXAM, NOT EXACTLY THE SAME**
1.WAP to print the sum of two numbers 50, 30.
#numbers
a=50
b=30
s=a+b
print (s)
2. WAP to print the sum and average of three numbers 30, 40, 50.
#numbers
a=30
b=40
c=50
s=a+b+c
av=s//3
print (s)
print (av)
5. WAP to print the area and perimeter of a rectangle of length 12cm and breadth 7cm.
#numbers
l=12
b=7
p=2*(l+b)
a=l*b
print (p)
print (a)
6. WAP to print the perimeter of triangle whose sides are 7cm, 5cm, 3cm.
#numbers
a=7
b=5
c=3
p=a+b+c
print (p)
7. WAP to print the area and perimeter of a square whose side is 5cm.
#numbers
s=5
p=4*s
a=s*s
print (p)
print (a)
8. WAP to print the simple interest and total amount of principal amount Rs.5000, time 3 years and rate of interest
10%.
#simple_interest
P=5000
t=3
r=10
si=(p*t*r)//100
ta=p+si
print (si)
print (ta)
9. WAP to convert 5kg 250g, 10kg 150g, 9kg 125g to gram and print their sum.
#convert
a = (5*1000)+250
b = (10*1000)+150
c = (9x1000)+125
s=a+b+c
print (s)
10. WAP to print the cost of one apple when the cost of 5 apple is Rs.80.
#wordproblem
a=80
b=5
c=a//b
print (c)
11. WAP to print the cost of 8 mangoes when the cost of one mango is Rs.12.
a=12
b=8
c=a*b
print(c)
4) WORKING 5) WORKING
a = 10 p = (a * b) // 5 x = 35 z = (x // y) + z
b=3 = (10 * 3) // 5 y=7 = (35 // 7) + 2
p = (a * b) // 5 = 30 // 5 z = (x // y) + 2 =5+2
print (p ** 2) =6 print (z * y) =7
print (6 ** 2) print (z * y)
= 6 x 6 = 36 = 7 * 7 = 49
Output = 36 output = 49