Starting from:
$30

$24

CMP_SC 2050 Lab 1 (5 Points)

Objectives:

    • Get Comfortable with the IDE.

    • Solve some problems in C.



Note: If your code does not compile with –Wall and –Werror, you will receive a zero for this assignment.


Description:

Implement a function, called compare, that compares two integers, a and b. If a <= b, then compute a - b, otherwise compute b - a. This function takes two integers as inputs and stores the output difference of a and b in a pointer.

Every user-defined function must have a comment describing:

    1. What function does;

    2. What parameter values are;

    3. What value it returns.

You also need to finish at least three peer reviews within two days of this lab.

Otherwise, you will get 15% penalty.



Function Prototype:

    • void compare (int input1, int input2, int * output);



Grading Criteria:

•    Working function:    3 points

•    Main program to test:    1 point

•    Comments:    1 point







1

More products