Code:
#include stdio.h
#include math.h
void main()
{
float side, surfacearea, volume;
printf("Enter the length of a side \n");
scanf("%f", &side);
surfacearea = 6.0 * side * side;
volume = pow(side, 3);
printf("Surface area = %6.2f and Volume = %6.2f \n", surfacearea,
volume);
}
Output:
Enter the length of a side
34
Surface area = 6936.00 and Volume = 39304.00
More C Programs: