complete chapter 5 exercises

This commit is contained in:
Akbar Rahman 2023-10-03 11:43:48 +01:00
parent d927ba186b
commit 1748a31acd
Signed by: alvierahman90
GPG Key ID: 20609519444A1269
2 changed files with 22 additions and 0 deletions

11
C5/ex4.c Normal file
View File

@ -0,0 +1,11 @@
#include <stdio.h>
#include <math.h>
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);
}

11
C5/ex5.c Normal file
View File

@ -0,0 +1,11 @@
#include <stdio.h>
#include <math.h>
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);
}