+ 1
Program on how to calculate volume of a sphere
2 Antworten
0
#Python
#Calculate volume of a sphere
import numpy as np
r = int(input('Enter radius:'))
v = 4 * np.pi * (r**3) / 3
print('The volume is:')
print(v)
Perhaps it is something like this.
0
here it is a helper function(not a good one):
void area(int r) {
const double pi = 3.141592;
cout << "area is " << 4./3.*pi*r*r*r;