Question: Consider the following C program, called max, taking command line arguments: #include #include int main(int argc, char *argv[]) { if (argc = 3){ printf(usage:

Consider the following C program, called max, taking command line arguments: #include #include int main(int

Consider the following C program, called max, taking command line arguments: #include #include int main(int argc, char *argv[]) { if (argc = 3){ printf("usage: %s number1 number2 ", argv[0]); } } else { } long number1, number2, max, min; char *ptr; number1= strtol (argv[1], &ptr, 10); number2 = strtol (argv[2], &ptr, 10); if(number1>number2) { max number1; min number2; } else{ max number2; min number1; } printf("max = %d and min = %d ", max, min); Which one of the following command line instructions is correct to use this program? O a. $./max 58 O b. $./max 58 O c. $./max 8 9 6 O d. $./max ab O e. $ ./max a b c

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The code is as follow include include int mainint argc char argv if argc 3 print... View full answer

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 Programming Questions!