0% found this document useful (0 votes)
25 views

3 Pyprogram

The document contains 8 programming problems with solutions: 1) A program to convert US dollars to Indian rupees by multiplying the dollar amount by 82. 2) A program to convert bits to megabytes, gigabytes, and terabytes by dividing the bit amount by increasing powers of 1024. 3) A program to calculate the square root of a number using the exponent operator.

Uploaded by

ciscopackett498
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)
25 views

3 Pyprogram

The document contains 8 programming problems with solutions: 1) A program to convert US dollars to Indian rupees by multiplying the dollar amount by 82. 2) A program to convert bits to megabytes, gigabytes, and terabytes by dividing the bit amount by increasing powers of 1024. 3) A program to calculate the square root of a number using the exponent operator.

Uploaded by

ciscopackett498
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/ 5

Name: Rais Saaim Ravish Enrollment No: 2105690153 Batch: 2

1)Write a program to convert U.S. dollars to Indian rupees.


print("Conversion of us dollar to indian rupees")
usd = int(input("Enter the amount:"))
inr = usd*82
print("INR:\t",inr)
OUTPUT
Conversion of us dollar to indian rupees
Enter the amount:50
INR: 4100

2) Write a program to convert bits to Megabytes, Gigabytes and Terabytes


print("convesion fo bits to byte,kb,mb,gb,tb")
bits = int(input("Enter the no of bits"))
byte = bits/8
kb = byte/1024
mb = kb/1024
gb = mb/1024
tb = gb/1024
print("kb:\t",kb)
print("mb:\t",mb)
print("gb:\t",gb)
print("tb:\t",tb)
OUTPUT
convesion fo bits to byte,kb,mb,gb,tb
Enter the no of bits8
kb: 0.0009765625
mb: 9.5367431640625e-07
gb: 9.313225746154785e-10
tb: 9.094947017729282e-13

3) Write a program to find the square root of a number


n = int(input("Enter the number"))
a = n**0.5
print(a)
OUTPUT
Enter the number36
6.0

4) Write a program to find the area of Rectangle


l = int(input("Enter the lenght of rectangle"))
b = int(input("Enter the breadth of rectangle"))
area = l*b
print(area)
OUTPUT
Enter the lenght of rectangle23
Enter the breadth of rectangle10
230
5) Write a program to calculate area and perimeter of the square
s = int(input("Enter the side of square"))
s*=s
p = 4*s
print("area of square:\t",s)
print("perimeter of square:\t",p)
OUTPUT
Enter the side of square7
area of square: 49
perimeter of square: 196

6) Write a program to calculate surface volume and area of a cylinder.


r = int(input("Enter the radius"))
h = int(input("Enter the height"))
pi = 3.14
v = pi*(r*r)*h
sa = (2*pi*r*h)+(2*pi*(r*r))
print("volume is:\t",v)
print("area is:\t",sa)
OUTPUT
Enter the radius20
Enter the height37
volume is: 46472.0
area is: 7159.200000000001
7) Write a program to swap the value of two variables
a = 10
b = 20
print("before swapinng")
print(a)
print(b)
b,a =a,b
print("after swapinng")
print(a)
print(b)
OUTPUT
before swapinng
10
20
after swapinng
20
10

8)wap to solve following equation


a = int(input("Enter the number"))
b = int(input("Enter the number"))
c = int(input("Enter the number"))
d = (((a+b)**2)+((c**0.5)+((a**2)**3)))/2
print(d)
OUTPUT
Enter the number10
Enter the number20
Enter the number30
500452.7386127875

You might also like