Question: kindly write a c program and give the steps explanation as wellfor fir the attached. To be done in utty terminal.CS 4 1 0 Operating

kindly write a c program and give the steps explanation as wellfor fir the attached. To be done in utty terminal.CS 410 Operating Systems
Lab Assignment #4
More Interrupts and Signals
Continuing with signals and using as a base your previous program, write another using the
SIGFPE to catch a fatal arithmetic error.
Use two integer arrays of size 5. Randomly chosen, one element of the first array will be divided
by another element from the second array also randomly chosen. One of the elements of the
second array must contain a zero as a value. Before the operation display the number whosen
for the division, use a different seed in the random function to avoid having the same sequence
every time. Use a delay of one second between the divisions. Keep it as an integer operation to
make things easier.
The SIGFPE signal reports a fatal arithmetic error. Although the name is derived from
"floating-point exception", this signal actually covers all arithmetic errors, including division by
zero and overflow. If a program stores integer data in a location which is then used in a
floating-point operation, this often causes an "invalid operation" exception, because the
processor cannot recognize the data as a floating-point number.
Terminate or stop the program using another signal called from within your program (not just
"exit (0)"). Use the command "kill -" to display the signals available.
kindly write a c program and give the steps

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 Programming Questions!