This repository has been archived on 2023-10-26. You can view files and clone it, but cannot push or open issues or pull requests.
VSMechatronics/C5/ex4.c

12 lines
211 B
C
Raw Normal View History

2023-10-03 10:43:48 +00:00
#include <stdio.h>
#include <math.h>
int main() {
float r;
printf("Enter radius: ");
scanf("%f", &r);
2023-10-03 11:41:18 +00:00
printf("Area of sphere: %f\n", 4.0*M_PI*r*r);
2023-10-03 10:43:48 +00:00
printf("Volume of sphere: %f\n", M_PI*r*r*r*4.0/3.0);
}