Question: Using Unix system calls, read() and write(), write a C program for integer basic arithmetics. Your program should follow the following sequential steps. Prompt
Using Unix system calls, read() and write(), write a C program for integer basic arithmetics. Your program should follow the following sequential steps. Prompt the message "This program makes simple arithmetics". Get in an infinite loop then 1. Write the message "Enter an arithmetic statement, e.g., 34+ 132>", 2. Read the whole input line, using the system call read() 3. Convert the input line into an integer, a character and an integer, respectively, using your own statements. . 4. In case of a wrong statement, print Wrong statement, 5. In case of division by zero, print Division by 0. 6. In case of a wrong op print Wrong operator, 7. Otherwise, perform the appropriate arithmetic operation, 8. Creates an output character buffer consisting of nl op n2 = result, 9. Writes the output buffer to the screen using system call write(). Using Unix system calls, read() and write(), write a C program for integer basic arithmetics. Your program should follow the following sequential steps. Prompt the message "This program makes simple arithmetics". Get in an infinite loop then 1. Write the message "Enter an arithmetic statement, e.g., 34+ 132>", 2. Read the whole input line, using the system call read() 3. Convert the input line into an integer, a character and an integer, respectively, using your own statements. . 4. In case of a wrong statement, print Wrong statement, 5. In case of division by zero, print Division by 0. 6. In case of a wrong op print Wrong operator, 7. Otherwise, perform the appropriate arithmetic operation, 8. Creates an output character buffer consisting of nl op n2 = result, 9. Writes the output buffer to the screen using system call write().
Step by Step Solution
There are 3 Steps involved in it
include include include define BUFFERSIZE 256 int main char message This program makes s... View full answer
Get step-by-step solutions from verified subject matter experts
