Question: Consider the following code segment: int main() { const int SIZE = 5; int iArray[SIZE]; B return 0; Answer the following questions: a) Using a
Consider the following code segment: int main() { const int SIZE = 5; int iArray[SIZE]; B return 0; Answer the following questions: a) Using a loop, write code to initialize array elements with a value from 5 to 9. (3 Marks) (CLO2: PLO6: C3) b) Write code to print array elements contents. (3 Marks) (CLO2: PL06: C3) c) Write code to ask user to enter any index of array. The code then will display the array value stored in that specific index. If the index is out of range, program will stop to loop. (Hint: to use a do-while loop) (5 Marks) (CLO2: PLO6: C3) Your
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
