[prev] 36 [next]

Exercise #4: Command Line Arguments

Write a program that
  • checks for a single command line argument
    • if not, outputs a usage message and exits with failure
  • converts this argument to a number and checks that it is positive
  • applies Collatz's process (Exercise 3, Problem Set Week 1) to the number