From cd1d50183b2fe38bb1446d804a0f9992ae2f8ed6 Mon Sep 17 00:00:00 2001 From: Alvie Rahman Date: Tue, 3 Oct 2023 12:41:18 +0100 Subject: [PATCH] print area of sphere not circle --- C5/ex4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C5/ex4.c b/C5/ex4.c index 207f22b..d5c7cb8 100644 --- a/C5/ex4.c +++ b/C5/ex4.c @@ -6,6 +6,6 @@ int main() { printf("Enter radius: "); scanf("%f", &r); - printf("Area of circle: %f\n", M_PI*r*r); + printf("Area of sphere: %f\n", 4.0*M_PI*r*r); printf("Volume of sphere: %f\n", M_PI*r*r*r*4.0/3.0); }