C Language | Surface Area and Volume of a Cube

Friday, 7 December 2012

When we play board games there will always be a dice that holds a series of numbers that represents how many our moves must be in the game. A dice is shaped like a cube, it has six equal sides. Cube shaped things are seen everywhere. I was always amazed by the cube because of its special form and unique shape, because of this I always wonder how to calculate its area and volume considering how big it can be.

As I was going through my High School and College years I learned how to calculate the area and volume of a cube and so much more things. To share and help you with calculating the area and volume of a cube I made a program that allows a user to calculate the said areas easily. Check out the sample code below.

     1:  
   2:  #include <conio.h>
   3:  #include <stdio.h>
   4:  #include <math.h>
   5:   
   6:  float sol1(float y, float n1)
   7:  { 
   8:          return y = n1 * n1 * n1;
   9:         
  10:          
  11:        }
  12:  float sol2(float z, float n1)
  13:  { 
Related Posts Plugin for WordPress, Blogger...