Solve this problem

Given the following lists of strings:

List 1

  1. "String 1"
  2. "String 22"
  3. "String 333"

List 2

  1. "String red"
  2. "String green"
  3. "String blue"

List 3

  1. "String small"
  2. "String med"
  3. "String large"

Write a simple program in C that accepts two integers as an argument and outputs to the console the following output, depending on which integers are received.

  • If the first integer is 0: use List 1.
  • If the first integer is 1: use List 2.
  • If the first integer is 2: use List 3.
  • If the second integer is 0: Print the elements of the chosen list in ascending order
  • If the second integer is 1: Print the elements of the chosen list in descending order
  • If the second integer is 2: Print only the shortest string in the list.

Please use as few conditional statements as possible. The fewer conditional statements your submission uses, the more favorably it will be evaluated. You may assume that the program will always be run with precisely two integer arguments, both in the range of 0-2. You do not need to add input validation to your application.

More Technical Directions:

  • Please compile with GCC
  • Please submit only your source file(s) and any instructions for compiling.