Question: C-PROGRAM C-PROGRAM C-PROGRAM C-PROGRAM C-PROGRAM C-PROGRAM C-PROGRAM C-PROGRAM C-PROGRAM C-PROGRAM C-PROGRAM C-PROGRAM The following program in C-language needs to use argc, argv, and atoi: 1.

C-PROGRAM C-PROGRAM C-PROGRAM C-PROGRAM C-PROGRAM C-PROGRAM C-PROGRAM C-PROGRAM C-PROGRAM C-PROGRAM C-PROGRAM C-PROGRAM

The following program in C-language needs to use argc, argv, and atoi:

1. Inside the main(), how would you use argc to determine how many numbers were entered on the command line?

For example: If the user inputs: 9 10 11 12

What should return is that amount of numbers entered from the command line is 4.

* Also, how would use MIN and MAX, so that the program will handle no input or too much input

--------------------------------------------------------------------------------------------------------

2. Inside the same main(), how would you use atoi and argv for a loop that takes each number, which could be written as a string and converts the string into an integer, and stores the integer into an array?

For example: Similar to the previous sequence, if the user input: 9, 10, "11", "12"

The loop should convert the strings "11" and "12" in ints 11 and 12, and store them into an array.

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!