In c program, I try this question, but still can't fix it.
EXERCISE - INDIVIDUAL: Scanning numbers into an array Write a C program scanning_into_array.c which scans in a certain amount of numbers from the user and fills an array with them. Download scanning_into_array.c here, or copy it to your CSE account using the following command: $ cp −n /web/dp1091/22T2/activities/scanning_into_array/scanning_into_array.c. First, it scans in the quantity of numbers from the user. Then, it scans in that many numbers from the user. Once the array is filled with the numbers the user input, call a pre-written function that prints the minimum and maximum values in that array Note: you do NOT need to write the minmax function, it is in the provided code, you are just required to call it properly after filling in the array yourself. This output verifies you scanned in the array correctly. $ ./scanning_into_array How many numbers: 5 Please enter numbers: 1 3 4 5 Minimum: 1 Maximum: 5 $ ./scanning_into_array How many numbers: 4 Please enter numbers: 3 -2 7 1 Minimum: -2 Maximum: 7 HINT: You will know how many integers the user provides. How do you scanf that many times? The code defines a MAX_SIZE for the max size of the array, you only need to fill the array, up to the number the user provides. For example, if the user enter 3 (as above), you should fill three elements of the array, even though the array contains enough space for MAX_SIZE elements.
In c program, I try this question, but still can't fix it.
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am