COMP2113
COMP2113_ENGG1340 Programming technologies and Computer programming II [Section 2BC] [2023]
Loading...
Searching...
No Matches
checkpoint6.3.cpp File Reference
#include <iostream>
Include dependency graph for checkpoint6.3.cpp:

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

◆ main()

int main ( void )

Definition at line 4 of file checkpoint6.3.cpp.

4 {
5 double x[2][2][3] = { { {3, 4, 2}, {0, -3, 9} }, { {13, 4, 56}, {5, 9, 3}}};
6 int max_value, min_value = x[0][0][0];
7 for (int i = 0; i < 2; i++){
8 for (int j = 0; j < 2; j++){
9 for (int k = 0; k < 3; k++){
10 if (x[i][j][k] > max_value){
11 max_value = x[i][j][k];
12 }
13 if (x[i][j][k] < min_value){
14 min_value = x[i][j][k];
15 }
16 }
17 }
18 }
19 cout << max_value << " " << min_value << endl;
20}