Question: Need help with this C programming assignment Objectives You should be able to: You must use function prototypes. DO NOT put functions above main Define
Need help with this C programming assignment
Objectives
You should be able to:
You must use function prototypes. DO NOT put functions above main
Define and initialize a 2D array
Read values fro a 2D array using loops
Define a function that take arrays as input
Instructions
You will need to write the following functions:
print2DArray - takes a 3 x 3 2D array and an integer representing the size of the array as input and prints the array to the console
fill2DArray - takes a 3 x 3 2D array. Use rand to fill the array with random integers between 1 and 9.
scale2DArray- takes a 3 x 3 2D array and an integer. It multiples all cells by the given integer and assigns that value back to the cell.
FOR EXAMPLE - scale of 2 on {{1, 2, 1}, {2, 2, 2}, {1, 1, 1}} ===> {{2, 4, 2}, {4, 4, 4}, {2, 2, 2}}
You will write a program that does the following
declare a 3 X 3 2D array filled with 0
call the print array function with the array as input
call the fill array function to fill it with random integers
call the print array function with the array as input
call the scale array function with any number you like other than 0 or 1
call the print array function with the array as input
print the sum of each row of the array
print the sum of each column of the array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
