Consider the following function main: int main() { int alpha[20]; int beta[20]; int gamma[4] = {11, 13, 15, 17}; int delta[10] = {3, 5, 2, 6, 10, 9, 7, 11, 1, 8}; . . . } a. Write the definition of the function setZero that initializes any one-dimensional array of type int to 0. b. Write the definition of the function inputArray that prompts the user to input 20 numbers and stores the numbers into alpha. Ex-10 ENGR2217 SP20 c. Write the definition of the function doubleArray that initializes the elements of beta to two times the corresponding elements in alpha. Make sure that you prevent the function from modifying the elements of alpha. d. Write the definition of the function printArray that prints any one- dimensional array of type int. Print 15 elements per line.
Consider the following function main:
int main()
{
int alpha[20];
int beta[20];
int gamma[4] = {11, 13, 15, 17};
int delta[10] = {3, 5, 2, 6, 10, 9, 7, 11, 1, 8};
. . .
}
a. Write the definition of the function setZero that initializes any one-dimensional array of type int to
0.
b. Write the definition of the function inputArray that prompts the user to input 20 numbers and stores
the numbers into alpha.
Ex-10 ENGR2217 SP20
c. Write the definition of the function doubleArray that initializes the elements of beta to two times
the corresponding elements in alpha. Make sure that you prevent the function from modifying the
elements of alpha.
d. Write the definition of the function printArray that prints any one- dimensional array of type int.
Print 15 elements per line.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps