1. Write a program to accepts two integers and print their sum.
a=int(input('Enter the first integer:'))
b=int(input('Enter the second integer:'))
sum=a+b
print('The two integers are:', a, b)
print('The sum of two integers are:', sum)
2.Write a program that accepts radius of a circle and prints its area.
r=int(input('Enter the radius of circle:'))
area=3.14*r**2
print('The area of the circle is:', area)
3. Write a program that accepts base and height and calculate the area of
triangle.
b=float(input('Enter the base of triangle:'))
h=float(input('Enter the height of triangle:'))
area=(1/2)*b*h
print('The area of triangle is:', area)
4. Write a program that inputs a student’s marks in three subjects (out of
100) and prints the percentage marks.
print('Enter the marks of three subject out of 100')
a=float(input('Enter the marks of first subject:'))
b=float(input('Enter the marks of second subject:'))
c=float(input('Enter the marks of third subject:'))
P=(a+b+c)/3
print('The percentage marks are:', P,'%')
5. Write a program to compute area of square and triangle.
a=float(input('Enter the value of side:'))
area_square=a**2
area_triangle=((3**0.5)/4)*a**2
print('The area of square is:', area_square)
print('The area of triangle is:', area_triangle)
6. Write a program to calculate simple interest.
Formula: si=(principle X rate X time)/100
7. Write a program to calculate Compound interest.
Formula: CI= Principal (1 + Rate)Time – Principal
8.To calculate EMI for Amount, Period and Interest.