Hello I need some help with creating a function in c++
It has to be an Two-Dimensional array put in a function
and it basically should output 20 rows and 20 columns
if anyone can provide explanation it would be great
#include <iostream>
using namespace std;
void generate_2d() {
int arr[20][20]; // generate a 2D array
for (int i = 0; i < 20; ++i) { // go through all rows
for (int j = 0; j < 20; ++j) { // go through all columns of each row
arr[i][j] = i * j; // storing some value in each array element
}
}
// Now, let's print the array
for (int i = 0; i < 20; ++i) { // go through all rows
for (int j = 0; j < 20; ++j) { // go through all columns of each row
cout << arr[i][j] << "\t"; // print the element
}
cout << endl; // print a newline after each row
}
}
int main() {
generate_2d();
return 0;
}

Hello I need some help with creating a function in c++ It has to be an...