For each line in the file, your program should fork a child process, in the child process
Question:
For each line in the file, your program should fork a child process, in the child process execute the program ALU and pass it the three values that you read from this line as arguments. Once all lines have been executed, you will wait for the child ALU processes to finish execution and read the return values sent by these processes. You will output the result of the operations in a file called math.txt in the following format
3 + 6 = 9
Page 2 of 2
12 – 4 = 8
3 x 10 = 30
4 24 = not enough arguments
Keep in mind that an operation might produce a floating point exception. For example the following is not possible mathematically
6 / 0
For operations like this, your program should report the following in the math.txt file
6 / 0 = illegal operation
You should NOT check for the numbers to be zero. You should get the exit status from the “wait” call and check if the program terminated due to an exception.