-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex2.cpp
More file actions
33 lines (27 loc) · 805 Bytes
/
ex2.cpp
File metadata and controls
33 lines (27 loc) · 805 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
#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;
}
int volume(int height,int width,int length){
return height*width*length;
}