Question: CENG328 Operating Systems - Spring 2017 Labwork 2 Feb 27 Mar 01, 2017 Question 1 Write a program in C which first initializes an integer
CENG328 Operating Systems - Spring 2017 Labwork 2 Feb 27 Mar 01, 2017 Question 1 Write a program in C which first initializes an integer variable to a random value between 100 and 200. By using signal() system call for SIGINT, alter the behaviour of Ctrl-C such that whenever this combination is pressed, the program switches between adding or subtracting 10 from this variable in an endless loop with 1 second delays. Your program must indicate whether it is increasing or decreasing the variable and it must end if value of the variable is below 100 or above 200. Sample Run $ ./question1 [Increasing] Variable: 188 Variable: 198
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
