Created
December 6, 2021 02:51
-
-
Save aeristhy/0fa0050b75de8e6d3105c21ef8aae138 to your computer and use it in GitHub Desktop.
Using multidimensional arrays that creates a program that will display the multiplication table up to 49 only. (Array Exercises #4)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
constexpr int rows{ 8 }; | |
constexpr int cols{ 8 }; | |
int product[rows][cols]{}; | |
for (int row{ 1 }; row < rows; ++row) { | |
for (int col{ 1 }; col < cols; ++col) { | |
product[row][col] = row * col; | |
} | |
} | |
for (int row{ 1 }; row < rows; ++row) { | |
for (int col{ 1 }; col < cols; ++col) { | |
cout << product[row][col] << '\t'; | |
} | |
cout << '\n'; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment