Description
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:
-
What function does;
-
What parameter values are;
-
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