Discover the best answers at Westonci.ca, where experts share their insights and knowledge with you. Connect with a community of experts ready to provide precise solutions to your questions on our user-friendly Q&A platform. Get immediate and reliable solutions to your questions from a community of experienced professionals on our platform.
Sagot :
The program is an illustration of arrays; Arrays are variables that are used to hold multiple values of the same data type
The main program
The program written in C++, where comments are used to explain each action is as follows:
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main(){
//This declares the array
int myArray[4][5];
//This seeds the time
srand(time(NULL));
//The following loop generates the array elements
for(int i = 0; i< 4;i++){
for(int j = 0; j< 5;j++){
myArray[i][j] = rand()%(61)-30;
}
}
//The following loop prints the array elements as grid
for(int i = 0; i< 4;i++){
for(int j = 0; j< 5;j++){
cout<<myArray[i][j]<<" ";
}
cout<<"\n";
}
return 0;
}
Read more about arrays at:
https://brainly.com/question/22364342
We appreciate your time. Please revisit us for more reliable answers to any questions you may have. We hope our answers were useful. Return anytime for more information and answers to any other questions you have. Get the answers you need at Westonci.ca. Stay informed by returning for our latest expert advice.