Skip to content

Instantly share code, notes, and snippets.

@waspyfaeleith
Last active April 21, 2017 09:38
Show Gist options
  • Save waspyfaeleith/3da5226fff0fbf8530b9 to your computer and use it in GitHub Desktop.
Save waspyfaeleith/3da5226fff0fbf8530b9 to your computer and use it in GitHub Desktop.
calc-u-l8r in C

Task - calc-u-l8r in c

Write a command line calculator application in C

Tasks:

  1. You already have the code to perform an addition, now add the following:

    functionality for 'subtraction'

    functionality for 'multiplication'

    functionality for 'division'

Possible further work:

  1. implement further calculations

    functionality for modulus

    any other you can think of/would like to implement.

  2. consider validating user input

    • what to do if they enter choices not in the menu

    • can you anticipate any user input that might give unintended side effects (and how could you prevent it?)

  3. can you think of any ways the code could be improved?

    • use of other C constructs you have learned
  4. any other changes you think would make the app better?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment