• Language

    SciLab

  • Description

    It allows the user to enter a value for one edge of a cube. The program calculates the surface area of one side of the cube, the surface area of the cube, and its volume.

1
2
3
4
5
6
7
8
one_edge = input ("Enter the value of one edge: ");
one_side_surface_area=one_edge*one_edge;
cube_surface_area=one_side_surface_area*6;
volume=one_edge*one_edge*one_edge;
printf ("Value of cube surface area: %g\n", cube_surface_area);
printf ("Value of one side surface area: %g\n", one_side_surface_area);
printf ("Value of volume: %g\n", volume);
end