Вы находитесь на странице: 1из 4

PCS01_SEC B_HW3_1224_VAMSI

KRISHNA PANUGANTI

OUTPUT FOR OPTION 1 GIVEN IN
THE HINTS BY THE PROFESSOR.















INSTRUCTION TO COMPILE PROGRAMS:

HOW TO COMPILE: program using Fork()

1.download the files and copy them to Putty
2. to compile give a command gcc o fork fork.c
3. To execute give a command ./fork
4. then a line appears enter the value to get the sequence. Give some positive integer number for
example 8
5. then output will be generated.



TEST REPORT:

PROGRAM USING FORK:

1.We are doing this program using fork function call which create child function to a process

2.First after the fork() call in the main program , program will directly go to parent process in
else section at the end.

3.From there a child process is created and parent will be waiting for the child process to be
completed.

4.Child process has the algorithm of collatz conjecture and will return the sequence of numbers
to print them on to the screen.













Below is a screenshot of program (fork.c) code.






Below is a screenshot of program (fork.c) after executing.

Вам также может понравиться