C PROGRAM TO COMPUTE THE SURFACE AREA AND VOLUME OF THE CUBE | Indian Shout

You are here: » C PROGRAM TO COMPUTE THE SURFACE AREA AND VOLUME OF THE CUBE

C PROGRAM TO COMPUTE THE SURFACE AREA AND VOLUME OF THE CUBE


/*   Write a c program to compute the surface area and volume of a cube  */

#include <stdio.h>
#include <math.h>

void main()
{
float  side, surfArea, volume;

printf(“Enter the length of a side\n”);
scanf(“%f”, &side);

surfArea = 6.0 * side * side;

volume = pow (side, 3);

printf(“Surface area = %6.2f and Volume = %6.2f\n”, surfArea, volume);
}

/*——————————————
Output
Enter the length of a side
4
Surface area =  96.00 and Volume =  64.00

RUN2
Enter the length of a side
12.5
Surface area = 937.50 and Volume = 1953.12
——————————————*/

Similar Posts:

 
 
Posted by 0 Responses

Categories:PREPARATION MATERIALS;Tags: , , , , , , , ,

Free Email Newsletter

Stay Updates with this Blog. Get Free email newsletter updates..

And then confirm your email subcription

   

No Comment to “C PROGRAM TO COMPUTE THE SURFACE AREA AND VOLUME OF THE CUBE”

  1. No Comment yet. Be the first to comment...
Leave your comment here: