A C program is required to do the following: a) Sequentially accept input from the user for 15 integer values using a 1D array b) Reverse the order of elements in this array, such that if the user inputs 1 2 3 .. the reverse array will be .. 3 2 1 c) Multiply all the odd numbers in the array and store the result of the multiplication. d) Print out all the elements of the 1D array before and after the reverse operation of step ii) above as comma-separated values, as well as the result of the multiplication operation. Required: The program should generate an accurate output in the C programming language. Provide: - An analysis of the problem, i.e., the data and variable requirements - A proper algorithm for planning the solution. - Good programming practice, i.e., proper structuring of the program and the use of comments where necessary.
A C program is required to do the following:
a) Sequentially accept input from the user for 15 integer values using a 1D array
b) Reverse the order of elements in this array, such that if the user inputs 1 2 3 .. the reverse array will be .. 3 2 1
c) Multiply all the odd numbers in the array and store the result of the multiplication.
d) Print out all the elements of the 1D array before and after the reverse operation of step ii) above as comma-separated values, as well as the result of the multiplication operation.
Required:
The program should generate an accurate output in the C
- An analysis of the problem, i.e., the data and variable requirements
- A proper
- Good programming practice, i.e., proper structuring of the program and the use of comments where necessary.
Step by step
Solved in 4 steps with 2 images