aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--In class 11/In class 11/main.cpp50
1 files changed, 49 insertions, 1 deletions
diff --git a/In class 11/In class 11/main.cpp b/In class 11/In class 11/main.cpp
index 7bdbc4a..d88e3e1 100644
--- a/In class 11/In class 11/main.cpp
+++ b/In class 11/In class 11/main.cpp
@@ -1,4 +1,52 @@
// Name: Nataliia Brown
// Date: 2/15/24
// Class: CST 116
-// Assignment: In-Class Exercise 11 \ No newline at end of file
+// Assignment: In-Class Exercise 11
+
+#include <iostream>
+#include <ostream>
+
+using std::cout;
+using std::cin;
+using std::endl;
+
+const size_t ROW = 3;
+const size_t COLUMN = 3;
+
+void Print2DArray(int(&matrix)[ROW][COLUMN])
+{
+ for (auto i = 0u; i < ROW; ++i)
+ {
+ for (auto j = 0u; j < COLUMN; ++j)
+ {
+ cout << matrix[i][j] << " ";
+ }
+ cout << endl;
+ }
+ cout << endl;
+
+}
+
+
+int main() {
+
+ int matrix[ROW][COLUMN]{
+ {0,0,0},
+ {0,0,0},
+ {0,0,0}
+ };
+ int x = 0;
+
+ for (auto i = 0u; i < ROW; ++i)
+ {
+ for (auto j = 0u; j < COLUMN; ++j)
+ {
+ ++x;
+ matrix[i][j] = x;
+ }
+ }
+
+ Print2DArray(matrix);
+ return 0;
+}
+