Lab 1: Fork ()
• Objective:
✓ Understand the basic concept of process creation in Unix-like operating
systems using the fork() system call.
✓ Recognize that fork() creates an identical copy of the calling process, resulting
in both parent and child processes continuing from the same point.
• Lab Environment:
Use a system running Red Hat Enterprise Linux or a similar Linux distribution.
Tasks:
1-Calculate the Sum of Two Numbers
Write a C program that prompts the user to enter two integer numbers. The program should use
the fork () system call to create a child process.
• In the child process, calculate the sum of the two numbers, print the result of the
summation.
• In the parent process, print a message indicating the completion
2- Odd or Even
Write a C program that prompts the user to enter an integer. Use the fork() system call to create
a child process.
• In the child process, determine if the entered number is odd or even. Print the result in
the child process.
• In the parent process, wait for the child to complete and print a message indicating the
completion