Question: Visual Studio c++ task: Write a program using a 'cout' statement that displays the value of argc when you run your program with more than

Visual Studio c++ task:

Visual Studio c++ task: Write a program using a 'cout' statement that

Write a program using a 'cout' statement that displays the value of argc when you run your program with more than 1 command line argument. Demonstrate that when you pass 1, 2 or 3 arguments to your program via the command line, that your program displays the correct number of arguments to the console. The value of argc should be 2, 3 or 4 when 1, 2 or 3 arguments are passed to your program, respectively. [1 mark] Now extend the program so that it uses an 'if statement to output the following text which is dependent on the number of program arguments: 1 argument entered, write "One argument" to the console. (i.e. Set program argument to 41). and 81) program arguments to 41, 81 and -46). a. b. 2 arguments entered, write "Two arguments" to the console. (i.e. Set program arguments to 41 c. More than two arguments entered, print "More than two arguments" to the console. (i.e. Set [1 mark]

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!