0% found this document useful (0 votes)
4 views4 pages

Computer Orignal Phase 1

The document contains a series of Python programs that perform various mathematical calculations and checks. These include calculating sums, areas of shapes, percentages, simple interest, and checking for even/odd numbers, among others. Each program prompts the user for input and displays the results accordingly.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

Computer Orignal Phase 1

The document contains a series of Python programs that perform various mathematical calculations and checks. These include calculating sums, areas of shapes, percentages, simple interest, and checking for even/odd numbers, among others. Each program prompts the user for input and displays the results accordingly.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

# Write a program to accepts two integers and print their sum.

a=int(input('Enter the rst 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)

print("******************************************")

# 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)

print("******************************************")

# Write a program that accepts base and height and calculate the area of triangle
b= oat(input('Enter the base of triangle:'))
h= oat(input('Enter the height of triangle:'))
Area=(1/2)*b*h
print('The area of triangle is:', Area)

print("******************************************")

# 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= oat(input('Enter the marks of rst subject:'))
b= oat(input('Enter the marks of second subject:'))
c= oat(input('Enter the marks of third subject:'))
P=(a+b+c)/3
print('The percentage marks are:', P,'%')

print("******************************************")

# Write a program to compute area of square and triangle.


a= oat(input('Enter the value of side:'))
A=a**2
T=((3**0.5)/4)*a**2
print('The area of square is:', A)
print('The area of triangle is:', T)

print("******************************************")

# Write a program to calculate simple interest.


P= oat(input('Enter the principal amount in ₹'))
R= oat(input('Enter the rate of interest:'))
T= oat(input('Enter the time in years:'))
SI=(P*R*T)/100
print('The simple interest is :', SI)

print("******************************************")

# Write a program to read two numbers and prints their quotient and reminder
a= oat(input('Enter the dividend:'))
fl
fl
fl
fl
fl
fl
fl
fl
fl
fl
fi
fi
b= oat(input('Enter the divisor:'))
Q=a//b
R=a%b
print('The quotient is:', Q)
print('The remainder is:', R)

print("******************************************")

# Write a program to nd whether a given number is even or odd.


a=int(input('Enter the number:'))
if a%2==0:
print('The number is even')
else:
print('The number is odd')

print("******************************************")

# Write a program to nd largest among three integers


a=int(input('Enter the rst integer:'))
b=int(input('Enter the second integer:'))
c=int(input('Enter the third integer:'))
if a>b and a>c:
print(a, 'is the largest integer')
if b>a and b>c:
print(b, 'is the largest integer')
if c>a and c>b:
print(c, 'is the largest integer')

print("******************************************")

# Write a program to nd lowest among three integer.


a=int(input('Enter the rst integer:'))
b=int(input('Enter the second integer:'))
c=int(input('Enter the third integer:'))
if a<b and a<c:
print(a, 'is the smallest integer')
if b<a and b<c:
print(b, 'is the smallest integer')
if c<a and c<b:
print(c, 'is the smallest integer')

print("******************************************")

# Write a program to that accepts length and


# breadth of rectangle and calculate its area.
l= oat(input('Enter the length of rectangle:'))
b= oat(input('Enter the breadth of rectangle:'))
area=l*b
print('Rectangle Speci cations')
print('Length=',l)
print('Breadth=', b)
print('Area=', area)

print("******************************************")
fl
fl
fl
fi
fi
fi
fi
fi
fi
# Write a program that accepts weight in Kg
# and height in meters and calculate the BMI.
W = oat(input('Enter the weight in Kg:'))
H = oat(input('Enter height in meters:'))
BMI=W/(H**2)
print('BMI is:', BMI)

print("******************************************")

# Write a program that reads the number n # and print the value of n2, n3 and n4.
a= oat(input('Enter the value of n:'))
b=a**2
c=a**3
d=a**4
print('The value of n2 is:', b)
print('The value of n3 is:', c)
print('The value of n4 is:', d)

print("******************************************")

# Write a program to accept the marks of ve subjects


# and calculate the average marks.
a= oat(input('Enter the marks of rst subject:'))
b= oat(input('Enter the marks of second subject:'))
c= oat(input('Enter the marks of third subject:'))
d= oat(input('Enter the marks of fourth subject:'))
e= oat(input('Enter the marks of fth subject:'))
Average=(a+b+c+d+e)/5
print('The average marks are:', Average)

print("******************************************")

# Write a program to accept the height in cm and


# convert it into feet and inches.
a= oat(input('Enter your height in centimeters:'))
Feet=a*0.032
Inch=a*0.393
print('Your height in feet is:', Feet)
print('Your height in inch is:', Inch)

print("******************************************")

# Write a program that accepts the age and


# print if one is eligible to vote or not.
a=int(input('Enter your age:'))
if a>=18:
print('You are eligible to vote')
else:
print('You are not eligible to vote')

print("******************************************")

# Write a program that accepts two numbers and


# check if the rst number is fully divisible by second number or not.
fl
fl
fl
fl
fl
fl
fl
fl
fl
fi
fi
fi
fi
a= oat(input('Enter the rst number:'))
b= oat(input('Enter the second number:'))
if a%b==0:
print('The rst number is fully divisible by second number')
else:
print('The rst number is not fully divisible by second number')

print("******************************************")

#Write a program to read base, width and height of


#parallelogram and calculate its area and perimeter.
b= oat(input('Enter the base of parallelogram:'))
w= oat(input('Enter the width of parallelogram:'))
h= oat(input('Enter the height of parallelogram:'))
Area=b*h
Perimeter=2*(b+w)
print('The area of parallelogram is:', Area)
print('The perimeter of parallelogram is:', Perimeter)

print("******************************************")

#Write a program to accept the year and


# check if it is a leap year or not.
a=int(input('Enter the year:'))
if a%4==0:
print('This year is a leap year')
else:
print('This year is not a leap year')

print("******************************************")

# Write a program to obtain x, y, z and calculate 4x4+3y3+9z+6π.


import math
print('To calculate 4x4+3y3+9z+6π')
x= oat(input('Enter the number x:'))
y= oat(input('Enter the number y:'))
z= oat(input('Enter the number z:'))
b=(4*math.pow(x,4))+(3*math.pow(y,3))+(9*z)+(6*math.pi)
print('The result of the above expression is:',b)
fl
fl
fl
fl
fl
fl
fl
fl
fi
fi
fi

You might also like