this is the part of the code for creating child process
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/types.h>
main()
{
pid_t pid;
pid_t was declared as the variable of pid.But values are same like integers.
int x = 5;
pid = fork();
fork() is the function which create child process.
x++;
if(pid<0)
{
printf("process creation error");
exit(-1);
}
else if(pid==0)
{
printf("Child Process");
printf("\nChild Process ID is %d",getpid());
x++;
printf("\nValue of X is %d",x);
printf("\nProcess id of parent is %d",getppid());
}