**The Program in C that uses a function to calculate volume,surface area of a Sphere is given below**:

```
#include <stdio.h>
#include <math.h>
void sphere_volume_surface(double diameter, double *volume, double *surface) {
double radius = diameter / 2;
// Function to calculate the volume and surface area of a sphere
*volume = (4.0/3.0) * M_PI * pow(radius, 3);
*surface = 4 * M_PI * pow(radius, 2);
}
int main() {
double diameter, volume, surface;
printf("Enter the diameter of the sphere: ");
scanf("%lf", &diameter);
sphere_volume_surface(diameter, &volume, &surface);
printf("The volume of the sphere is: %lf\n", volume);
printf("The surface area of the sphere is: %lf", surface);
return 0;
}
```

## Output:

Enter the diameter of the sphere: 7

The volume of the sphere is: 179.594380

The surface area of the sphere is: 153.938040

## Pro-Tips**💡**

This program defines a function `sphere_volume_surface()`

that takes in three parameters: the diameter of the sphere, and two pointers to variables that will hold the calculated volume and surface area.

Inside the function, it calculates the radius of sphere by dividing the diameter by 2.

Then it uses the formulas for the volume and surface area of a sphere to calculate the values and assigns them to the variables pointed to by the pointers.

In the `main()`

function, the program prompts the user to enter the diameter of the sphere, and then calls the `sphere_volume_surface()`

function to calculate the volume and surface area.

The calculated values are then printed to the console

**Learn C-Sharp ↗**

C-sharp covers every topic to learn about C-Sharp thoroughly.

**Learn C Programming ↗**

C-Programming covers every topic to learn about C-Sharp thoroughly.

**Learn C++ Programming↗**

**Learn C++ Programming↗**

C++ covers every topic to learn about C-Sharp thoroughly.