CS Holiday Homework
CS Holiday Homework
Program-1
Aim: To display welcome message
Coding:
# Program1
Message= (input ("Enter a welcome message:"))
print (Message)
Output:
Program-2
Aim: To display the lager number/ smaller number between two numbers
Coding:
#Program2
n1=int(input("Enter first number:"))
n2=int(input("Enter second number:"))
if n1>n2:
print("Larger number is:",n1)
elif n2>n1:
print("Larger number is:",n2)
else:
print("Choose two different numbers")
Output:
Program-3
Aim: To display larger number between three numbers
Coding:
#Program3
n1=int(input("Enter first number:"))
n2=int(input("Enter second number:"))
n3=int(input("Enter third number:"))
Program-6
Aim: To calculate EMI of given amount, time period, rate
Coding:
#Program6 EMI Calculator
P=int(input("Enter the amount:"))
T=int(input("Enter time period:"))
R=int(input("Enter rate:"))
r= R/100
print("EMI:",P*r*(1+r)**T/(1+r)**T-1)
Output:
Program-7
Aim: To enter the price and GST rate of the product and print its market price
Coding:
#WAP to calculate GST/Income tax
Product=str(input("Enter product name:"))
SP=float(input("Enter the selling price of the product:"))
GST=float(input("Enter GST rate%="))
CGST=SP*((GST/2)/100)
SGST=CGST
A=SP+CGST+SGST
print(" CGST(@",(GST/2),"%)",(CGST))
print("SGST(@",(GST/2),"%):",(SGST))
print("Amount payble:",(A))
Output:
Program-8
Aim: To input three numbers from the user and print the largest number
Coding:
Program9
n1=int(input("Enter first number:"))
n2=int(input("Enter second number:"))
n3=int(input("Enter third number:"))
Program-9
Aim: To input the name and age of the user and display a welcome message
Coding:
#Program9
Name=input("Enter your name:")
Age=int(input("Enter your age:"))
print("Welcome",Name,",your age is",Age,".")
Output:
Program10
Aim: To accepts radius of a circle from user and display it’s area
Coding:
#Program10
r=float(input("Enter radius of the circle:"))
import math
print("Area of the circle is",math.pi*r**2)
Output: