CBSE Class 11 Computer Science
Question 170 of 173
Data Handling — Question 22
Back to all questions 22
Question Question 22
Write a program to input the radius of a sphere and calculate its volume (V = 4/3πr3)
Solution
import math
r = float(input("Enter radius of sphere: "))
v = 4 / 3 * math.pi * r ** 3
print("Volume of sphere = ", v)Output
Enter radius of sphere: 3.5
Volume of sphere = 179.59438003021648