C PROGRAM C PROGRAM C PROGRAM C PROGRAM C PROGRAM C PROGRAM C PROGRAM C PROGRAM C PROGRAM C PROGRAM C PROGRAM C PROGRAM C PROGRAM For the main of this program, argc, argv, and atoi need to be used: 1. Inside the main(), how would you use argc to determine how many numbers were entered on the command line? 2. Inside the same main(), what would a loop that takes each number, that could be written as a string (example: "123" to 123) and converts the string into an integer, and stores the integer into an array look like? * For the array list, how would we use MIN and MAX so that the user does not enter too large or too small of an input, by using #define? ------------------------------------------------------------------------------------------------------------------------------------------------- Outside the main(), there should be a function that does the following: 1. Calculates the average of the numbers in the previously mentioned array, and prints(use integer division) (For example: 10, 20, 30) - Average: 20 2. Finds and print the largest and smallest number in the array. (For example: 10, 20, 30) - MAX : 30 - MIN: 10 * Have the main(), call towards this function to calculate and print these values Please give proper explanation and typed answer only.
C PROGRAM C PROGRAM C PROGRAM C PROGRAM C PROGRAM C PROGRAM C PROGRAM C PROGRAM C PROGRAM C PROGRAM C PROGRAM C PROGRAM C PROGRAM
For the main of this program, argc, argv, and atoi need to be used:
1. Inside the main(), how would you use argc to determine how many numbers were entered on the command line?
2. Inside the same main(), what would a loop that takes each number, that could be written as a string (example: "123" to 123) and converts the string into an integer, and stores the integer into an array look like?
* For the array list, how would we use MIN and MAX so that the user does not enter too large or too small of an input, by using #define?
-------------------------------------------------------------------------------------------------------------------------------------------------
Outside the main(), there should be a function that does the following:
1. Calculates the average of the numbers in the previously mentioned array, and prints(use integer division)
(For example: 10, 20, 30) - Average: 20
2. Finds and print the largest and smallest number in the array. (For example: 10, 20, 30)
- MAX : 30 - MIN: 10
* Have the main(), call towards this function to calculate and print these values
Step by step
Solved in 2 steps with 2 images