Question: 3. 4. QUESTION 1 [20 MARKS) Figure I shows code of a program that prints tho tum, average or maumum number in an array Bullding

 3. 4. QUESTION 1 [20 MARKS) Figure I shows code of

3. 4. QUESTION 1 [20 MARKS) Figure I shows code of a program that prints tho tum, average or maumum number in an array Bullding the program however results in several error and warning messages that resulted in the program not working as Intended. Correct the code by listing the line numbers explain the errors and suggest corrections for the error [15 marks] 1. #include 2. int main() { double array[10] - (10, 26.8, 87, 3.14, 87, 65, 2, 34, 63, 4); double answer; int i; printf ("Please choose mode> "); scanf (" %c", &mode); 10. else if (mode == 's') { 12. for (i = 0; i 15. ) 5. 6. 7. 8. 9. 11. 14. 16 20. 24 D 16. 17. else if (mode ss ''){ 18. for (i = 0; i answer) { 28. answer array[i]; 29. > 30. > 31. 32. else { 33. printf("Invalid option"); 34. return -99 35. ) 36. 37. printf("Answer: 3f); 38. return 0; 39.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!