168k views
4 votes
To complete this quest, answer the following questions in the submission box below. Make x an array going from 0 to 100 by steps of 2 units. (Array indexing) Make y an array going from 0 to 50 by steps of 1 unit. (Array indexing) Make z an array that is equal to [x1y1, x2y2, ..., xnyn]. (Arithmetic operations) Find the first 5 values of the z array. (Array indexing)

1 Answer

0 votes

Answer:

C++.

Step-by-step explanation:

#include <iostream.h>

void main(int argc,char* arg[]) {

// Arrays

int x[100];

int y[50];

int z[50];

////////////////////////////////////////////////////////////////////////////

int count = 0;

for (int i = 0; i < 100; i+=2) {

z[count] = x[i] * y[count];

count++;

}

for (int i =0; i < 5; i++) {

cout<<z[i]<<endl;

}

getche();

}

User EmpireJones
by
5.4k points