/* Compile with `clang -std=c99 -Wall -o u3_cube u3_cube.c`
/* Test with `../checkproject u3_cube` *//* Compile with `clang -std=c99 -Wall -o u3_cube u3_cube.c`
/* Test with `../checkproject u3_cube` */Include C-libraries for input/output.
#include <stdio.h>
#include <stdlib.h>Read the edge length of a cube (as a decimal number). Then print the volume and the surface area. The result should be printed with two digits after the decimal point.
int main() {We work width a double precision variable.
double d;The scanf format code %lf means long float, which is a double.
scanf("%lf", &d);Directly pass the calculation results to printf, ensuring two
decimal places with the .2 format code prefix.
printf("Volume: %.2lf\n", d * d * d);
printf("Surface Area: %.2lf\n", 6 * d * d);Return code 0 for everything OK.
return 0;
}