Question: Use a for loop to fill the array with numbers 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2,

Use a for loop to fill the array with numbers 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2. Complete the code below.

#include  using namespace std; void print_array(int a[], int size); int main() { const int SIZE = 18; int x[SIZE]; for (.......) { x[i] = .....; } printArray(x, SIZE); return 0; } /** Prints an array of comma separated int. @param a the array of strings @param size the size of the array */ void printArray(int x[], int size) { cout << "["; if (size > 0) { cout << x[0]; for (int i = 1; i < size; i++) { cout << ", " << a[i]; } } cout << "]" << endl; } 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!