Please code in C language
Posted: Wed Apr 27, 2022 3:33 pm
Please code in C language
(a) Declare a one-dimensional integer array DATA to store 1000 elements. Assume that you have initialized this array DATA. Draw a flow-chart that captures the logic for finding the following quantities: (i) minimum value in this array, (ii) number of minimum values, and (iii) indices where they occur in your array. Note that the minimum value may occur more than once. (8 Marks) (b) Write a C function MinData (..) that implements the above described flow-chart in Q2(a). Your MinData () must also determine the number of minimum values in DATA. Print the following quantities with meaningful messages: (i) minimum value in this array, (ii) number of minimum values, and (iii) indices where they occur in your array. (10 Marks) (c) What is your estimate of the number of iterations (time) taken to run your function MinData (..)? (2 Marks)
(a) Declare a one-dimensional integer array DATA to store 1000 elements. Assume that you have initialized this array DATA. Draw a flow-chart that captures the logic for finding the following quantities: (i) minimum value in this array, (ii) number of minimum values, and (iii) indices where they occur in your array. Note that the minimum value may occur more than once. (8 Marks) (b) Write a C function MinData (..) that implements the above described flow-chart in Q2(a). Your MinData () must also determine the number of minimum values in DATA. Print the following quantities with meaningful messages: (i) minimum value in this array, (ii) number of minimum values, and (iii) indices where they occur in your array. (10 Marks) (c) What is your estimate of the number of iterations (time) taken to run your function MinData (..)? (2 Marks)