CS 246 Lab 7
  1. Write a C program called triangle that takes two command line arguments. The first is an integer code that should be in the range 1-4. The second is an integer that is a size (call it n). The program will print a triangle of size n. The first argument will determine the shape of the triangle. Check that there are two command line arguments, print a usage message to stderr, and exit with status 1 if not. Use a switch statement.
    CodeShape
    1
    *
    **
    ***
    ****
    *****
    2
       *
      **
     ***
    ****
    3
    ******
    *****
    ****
    ***
    **
    *
    4
    ****
     ***
      **
       *
  2. Write a C program called ftoc that reads a Fahrenheit temperature and prints the Celcius equivalent to the nearest tenth of a degree. Do not do any error checking.
  3. Write a C program called toupper that reads characters from stdin and prints them back out to stdout, converting lower case characters to upper case. Characters other than letters should be printed unchanged. Use isalpha to toupper (read the man pages). Use the standard litany for reading a file one character at a time.