Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions