423,821 views
32 votes
32 votes
Define a class Sphere to input radius of a sphere and compute the volume of it. Volume = πr3 (where π=3.14)​

User FrancescoMM
by
2.6k points

1 Answer

19 votes
19 votes

Lets use Python

Program:-


\tt r=(float(input(


\tt V=4/3*3.14*r**3


\tt print(

Output:-


\tt Enter\:the\:radius\:of\:the\:sphere=3


\t Volume\:of\:the\:Sphere=103.4

User ETL
by
3.2k points