diff --git a/C5/ex4.c b/C5/ex4.c new file mode 100644 index 0000000..207f22b --- /dev/null +++ b/C5/ex4.c @@ -0,0 +1,11 @@ +#include +#include + +int main() { + float r; + printf("Enter radius: "); + scanf("%f", &r); + + printf("Area of circle: %f\n", M_PI*r*r); + printf("Volume of sphere: %f\n", M_PI*r*r*r*4.0/3.0); +} diff --git a/C5/ex5.c b/C5/ex5.c new file mode 100644 index 0000000..9fb188e --- /dev/null +++ b/C5/ex5.c @@ -0,0 +1,11 @@ +#include +#include + +int main() { + float r; + printf("Enter radius: "); + scanf("%f", &r); + + printf("Area of circle: %0.2f\n", M_PI*r*r); + printf("Volume of sphere: %.02f\n", M_PI*r*r*r*4.0/3.0); +}