-
Notifications
You must be signed in to change notification settings - Fork 0
/
volume.c
41 lines (33 loc) · 893 Bytes
/
volume.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: main.c
* Author: Arshad shah
*
* Created on 01 October 2019, 09:30
*/
#include <stdio.h>
#include <stdlib.h>
/*
*
*/
int main()
{
//volume of a box
//volume variables declared and initialized
int height = 10;
float length = 11.5;
float width = 2.5;
float volume;
float surface;
//calculation of volume
volume = length * width * height;
printf("The volume of the box is %f cm^3.\n",volume);
//calculation for rectangular cuboid
surface = 2*( height*length + width*height + width*length);
printf("The Surface Area of the object is %f cm^2.\n",surface);
return 0;
}