Scope) #include using namespace std; 1 2 3 4 5 6 7 8 9 10 11 void initAlpha(int arr[], int N); void doubleAlp
Posted: Sat May 14, 2022 7:30 pm
Scope) #include <iostream> using namespace std; 1 2 3 4 5 6 7 8 9 10 11 void initAlpha(int arr[], int N); void doubleAlpha(int alpha[], int beta[], int N); Noin 10 000) const int N_COLS = 4; pint main() 22 const int N = 20; const int N_ROWS = 10; 13 14 15 16 int alpha[N]; int beta[N]; int matrix[N_ROWS(N_COLSE 17 initAlpha(alpha, N); doubleAlpha(alpha, beta, N); 18 19 20 21 22 23 24 25 26 27 28 29 30 cout << "elements of alpha : "; for (int i = 0; i < N; i++) { cout << alpha << } cout << "\nelements of beta : "; for (int i = 0; i < N; i++) { cout << beta << " "; No issues found 6
for (int i = 0; i < N; i++) { cout << beta << " "; return 0; 28 29 30 31 32 33 34 35 36 37 38 39 Ovoid initAlpha(int arr[], int N) int low = 20; int high = 87; = 40 D for (int i = 0; i < N; i++) { arr = low + rand() % (high - low + 1); 41 42 43 44 45 46 47 48 49 50 51 52 avoid doubleAlpha(int alpha [], int beta[], int N) { B for (int i = 0; i < N; i++) { beta = 2 * alpha; 53 54 55
3. Write the definition of the function copyAlphaBetaMat that stores alpha into the first five rows of matrix and beta into the last five rows of matrix. Make sure that you prevent the function from modifying the elements of alpha and beta. 4. Write the definition of the function printArray that prints any one-dimensional array of type int. Print 15 elements per line.
for (int i = 0; i < N; i++) { cout << beta << " "; return 0; 28 29 30 31 32 33 34 35 36 37 38 39 Ovoid initAlpha(int arr[], int N) int low = 20; int high = 87; = 40 D for (int i = 0; i < N; i++) { arr = low + rand() % (high - low + 1); 41 42 43 44 45 46 47 48 49 50 51 52 avoid doubleAlpha(int alpha [], int beta[], int N) { B for (int i = 0; i < N; i++) { beta = 2 * alpha; 53 54 55
3. Write the definition of the function copyAlphaBetaMat that stores alpha into the first five rows of matrix and beta into the last five rows of matrix. Make sure that you prevent the function from modifying the elements of alpha and beta. 4. Write the definition of the function printArray that prints any one-dimensional array of type int. Print 15 elements per line.