-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexercise02.cpp
More file actions
39 lines (30 loc) · 950 Bytes
/
exercise02.cpp
File metadata and controls
39 lines (30 loc) · 950 Bytes
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
#include <iostream>
using namespace std;
int volume(int height, int width, int length);
int main() {
int box1Height, box1Width, box1Length;
int box2Height, box2Width, box2Length;
int totalVolume, totalSurface;
cout << "Enter Box 1 Height : ";
cin >> box1Height;
cout << "Enter Box 1 Width : ";
cin >> box1Width;
cout << "Enter Box 1 Length : ";
cin >> box1Length;
cout << "Enter Box 2 Height : ";
cin >> box2Height;
cout << "Enter Box 2 Width : ";
cin >> box2Width;
cout << "Enter Box 2 Length : ";
cin >> box2Length;
totalVolume = volume(box1Height, box1Width, box1Length)
+ volume(box2Height, box2Width, box2Length);
cout << "Volume of Box is " << totalVolume << endl;
return 0;
}
// Implement the Volume() function here
int volume(int height, int width, int length)
{
int vol = height * width * length ;
return vol;
}