/************************************************/ /* CSC 101 Fall 2013 Alex Dekhtyar */ /* */ /* Lab 1. */ /* */ /************************************************/ /* This program introduces you to the testing environment we will be using in the first half of the course. Study it carefully. Good luck! */ /* PREPROCESSOR DIRECTIVES */ #include /* Standard C library input/output (I/O) functions */ #include /* Standard C library mathematical functions */ #include "checkit.h" /* checkit.h: testing macros (by Dr. Aaron Keen) */ /* function main() */ int main() { /* In this program we use main() to test our function compute() */ /* for this, we use the checkit_int() macro defined in the checkit.h file */ /* Examples below illustrate how check_int() is used */ checkit_int(10, 10); /* checkit_int() requires two parameters. Both should be integer expressions */ checkit_int(10, 5+5); /* checkit_int() evaluates both expressions and compares them */ checkit_int(5+5, 20-10); /* checkit_int() reports if the two expressions yield the same result*/ /* The three tests above should all succeed */ /* The two tests below should fail */ checkit_int(7, 8); checkit_int(11,4+4); /* Complete the checkit_int() calls to make all tests below successfully pass */ /* Missing parameters are represented as "". Replace "" with integer constants */ /* to make the ALL tests pass. Remove comments around checkit_int() calls below */ /* test #1 */ /* checkit_int(7*3, ); */ /* test #2 */ /* checkit_int((4*4)/4, ); */ /* test #3 */ /* checkit_int(3+2*12, ); */ /* test #4 */ /* checkit_int(30/3/5, ); */ /* test #5 */ /* checkit_int(16/2*3, ); */ /* test #6 */ /* checkit_int(8/8-1, ); */ /* test #7 */ /* checkit_int(10/(10+10), ); */ /* test #8 */ /* checkit_int(40%8, ); */ /* test #9 */ /* checkit_int(30%4, ); */ /* test #10 */ /* checkit_int(5*10%3, ); */ return 0; /* According to ANSI C standards, main() must return an int value. */ /* We are not interested in what main() returns, so we return 0 */ }