Question: COMP2650_Lab05 Please complete in C programming :) Thank you so much! Step 2. Writing Modular Programs As we did in Lab04, let's add a new

 COMP2650_Lab05 Please complete in C programming :) Thank you so much!

COMP2650_Lab05

Please complete in C programming :) Thank you so much!

Step 2. Writing Modular Programs As we did in Lab04, let's add a new header file arithmetic.h and code (source) file arithmetic.cpp to implement all functions related to arithmetic in signed-magnitude. arithmetic.h void func_signed_mag_addition(int a[], int b[], int result[]); void func_signed_mag_subtraction(int a[], int b[], int result[]); arithmetic.cpp #define MAX 8//Byte = 8 bits void func_signed_mag_addition(int a[], int b[], int result[]){...} void func_signed_mag_subtraction(int a[], int b[], int result[]){...} As seen, header files contain only the signatures of the functions and not the bodies. Please look at the in the end of each function. Now we are ready to add the headers to our main program and use the functions in each separate file: 01 #include 02 #include "arithmetic.h" 03 04 #define MAX 8//Byte = 8 bits 05 int main(void) { U setbuf(stdout, NULL); int x[MAX]; int y[MAX]; 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28} printf("Enter the first binary number: "); for(int i=0; i 02 #include "arithmetic.h" 03 04 #define MAX 8//Byte = 8 bits 05 int main(void) { U setbuf(stdout, NULL); int x[MAX]; int y[MAX]; 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28} printf("Enter the first binary number: "); for(int i=0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!