Homework 3: Operators

Wednesday, February 15, 2012     


[Up] [Previous Homework] [Next Homework]


Complete the following:

  1. Create a new file called hw03.c
  2. Fill in file header, add stdio #include, and main function
  3. Ask the user to input 2 integers
  4. Print the result of adding the two integers
  5. Print the result of multiplying the two integers
  6. Print the result of subtracting the second integer from the first
  7. Print the integral result of dividing the first integer by the second (eg. 5 / 2 = 2)
  8. Print the integrel remainder of dividing the first integer by the second
  9. NOTE: You will get a fatal error if when you run your program you put in zero for the second integer, so don't do that for the script that you submit, though you can try it on your own and see what the result is
  10. EXTRA CREDIT: Along with the above, also print the floating point result of dividing the first integer by the second (eg. 5 / 2 = 2.5)
  11. Create a script of you compiling and then running your program 3 times, with different input each time.
  12. Once you are done, use submit to submit two files, hw03.c and typescript

    linux3[1]% submit cs104_sheets hw03 hw03.c typescript