Question 1 Sample Run Save PC Write a program in C which first initializes $ ./question1 [Increasing] Variable: 188 an integer variable to a random value between 100 and 200. By using signal()...


Question 1<br>Sample Run<br>Save PC<br>Write a program in C which first initializes $ ./question1<br>[Increasing]<br>Variable: 188<br>an integer variable to a random value<br>between 100 and 200. By using signal() Variable: 198<br><CTRL-O<br>[Decreasing]<br>such that whenever this Variable: 188<br>system call for SIGINT, alter the behaviour<br>of Ctrl-C<br>combination is pressed, the program Variable: 178<br>Variable: 168<br>switches between adding or subtracting 10 CTRL-O<br>from this variable in an endless loop with 1 [Increasing]<br>Variable: 178<br>second delays. Your program must indicate<br>Variable: 188<br>whether it is increasing or decreasing the variable: 198<br>variable and it must end if value of the Variable: 208<br>variable is below 100 or above 200.<br>as well. Parent should display process ID's<br>Question 2<br>Write a C program which creates a child of both child processes and terminate only<br>process. This child process must write after both of them are terminated.<br>1.000.000 random integers to a text file,<br>each seperated by one space character and Sample Run<br>then terminate. Parent process must wait $ ./question2<br>for this child process to terminate, then iCHILD1] Wrote 1000000 integers to<br>create an another child process. This new numbers.txt, terminating.<br>child process must count how many of the tCHILD2] Even numbers: 682722, odd<br>numbers in the text file are even and how numbers: 317278, terminating.<br>[PARENT] Child process ID: 22678<br>[PARENT] Child process ID: 22679<br>many of them are odd and then terminate [PARENT] Terminating.<br>

Extracted text: Question 1 Sample Run Save PC Write a program in C which first initializes $ ./question1 [Increasing] Variable: 188 an integer variable to a random value between 100 and 200. By using signal() Variable: 198
Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here