1. Engineering
  2. Computer Science
  3. workh driverc using c i need to create workc file...

Question: workh driverc using c i need to create workc file...

Question details

work.h

// given two int values, return 1 if they can be added without // overflow or underflow, otherwise return 0 // Your code must follow the Bit-Level Integer Coding Rules // on the textbook, page 128-129, you can assumew32 // The only al lowed operations in your code are: // This requirement is more restrictive than the coding rules // Note that this is different from practice problem 2.30 // because relative comparison operators (<, >, < and ) are forbidden // by the Bit-Level Integer coding rules. And local operations&&II are not // al lowed either int addoK( int a, int b); #end i f

driver.c

int myAddOK( int a, int b) I int sum = a + b; return !neg_over && !pos_over: void test ingAddoK int a[] = {0, -1, INT-MIN, INT-MAX, OxFFFF0000); int bl-10 INT MAX, -1, 3, 0xFFFF0001 int i int ok: int okStudent for (i =0; i 5: i++) { okStudentaddoK(ali, bl]): printf ok to add solution: XdWn , ok); printf ok to add student answer: dWn, okStudent) if (okStudentok) f printf( pass ₩n); else printf-fail-n)

Using C, I need to create work.c file with few operations that are allowed to use.

Thanks for your help!

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution