0% found this document useful (0 votes)
33 views11 pages

Documentation 10th (24-25)

Uploaded by

kajal.3317
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views11 pages

Documentation 10th (24-25)

Uploaded by

kajal.3317
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

1.

Write a program to print addition of two numbers

a = int(input("enter first number "))


b = int(input("enter second number "))
sum = a + b
print(sum)
2. Write a program to find Greater number in two numbers

a = int(input("Enter the first number: "))


b = int(input("Enter the second number: "))
if(a > b):
print(a, "is greater")
else:
print(b, "is greater")
3. Write a program to print even or odd number

num = int(input("enter a number:"))


if (num%2)==0:
print ("the number is even")
else:
print("the number is odd")
4. Write a program to show the marks of all the subjects and find that
student is pass or fail

eng=int(input("enter marks of english :"))


hindi=int(input("enter marks of hindi :"))
maths=int(input("enter marks of maths :"))
science=int(input("enter marks of science :"))
sst=int(input("enter marks of sst :"))
ai=int(input("enter marks of ai :"))
marks=(eng+hindi+maths+science+sst+ai)/6
if marks>50:
print("pass")
else:
print("fail")
5. Write a program to print Area of triangle

h=int(input("enter the value of height:"))


b=int(input("enter the value of base:"))
a= 1/2*b*h
print("area of the given triangle is:", a)
6. Write a program to print area of square

a=int(input("enter length in cm"))


x=a*a
print("your area of square is:", x)
7. Write a program to print area of circle

r=int(input("enter your radius"))


a=3.14*(r*r)
print("your area is:", a)
8. Write a program to print simple interest

P = int(input("Enter the principal amount :"))


T = int(input("Enter the time period :"))
R = int(input("Enter the rate of interest :"))
si = (P * T * R)/100
print ('The Simple Interest is', si)
9. Write a program in python to calculate compound interest

p = int(input("Enter the Principal Amount"))


r = int(input("Enter the Rate interest per annum"))
t = int(input("Enter the time in years"))
ci=p*(pow((1+r/100),t))
print(ci)
10. Write a program to check number is Armstrong or not

num=int(input("enter a number:"))
sum=0
temp=num
while temp>0:
digit=temp>10
sum+=digit**3
temp//=10
if num==sum:
print(num, " is an armstrong")
else:
print(num, "is not an armstrong")
11. Write a program to check the value of factorial

a=int(input("enter a number"))
factorial=1
if a<0:
print("sorry factorial does not exist for negative number")
elif a==0:
print("the factorial of 0 is 1")
else:
for i in range (1,a+1):
factorial=factorial*i
print("the factorial of ", a, "is", factorial)

You might also like