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
——————————————*/

indianshout android app
 
 

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

   

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:

 
Sponsored links
Free Email Updates

Get more Posts like this
in your inbox

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Sponsored Links