1. Write a program the calculates the volume of a sphere. Use a define to set Pi to 3.14 and a macro for the formula for the sphere. V = 4/3PiR3.
In main ask for the radius (R). Pass it to a function where you calculate the volume and return it to main and print the volume in main. Use float values. (Save this program as you'll need it later.)
Can you please help me?
Code:Code:#include<stdio.h> void fun (float); main() { float a; float v; printf("Please enter the radius: "); scanf("%.3f",&a); fun(a); printf("The volume is = %.3f", v); } void fun (float Radius) { float v,pi = 3.14; v = ((4/3)*pi*(Radius * Radius * Radius)); printf("%.3f",v); return(v); }