question given like this
The Fibonacci sequence is the series of numbers 0, 1, 1, 2, 3, 5, 8, .... Formally, it can be expressed as:
f ib0 = 0
f ib1 = 1
f ibn = f ibn−1 + f ibn−2
1) Write a C program using the fork() system call that that generates the Fibonacci sequence in the child process. The number of the sequence will be provided in the command line. For example, if 5 is provided, the first five numbers in the Fibonacci sequence will be output by the child process. Because the parent and child processes have their own copies of the data, it will be necessary for the child to output the sequence. Have the parent invoke the wait() call to wait for the child process to complete before exiting the program. Perform necessary error checking to ensure that a non-negative number is passed on the command line.
2) Repeat the preceding exercise, this time using the CreateProcess () in the Win32 API. In this instance, you will need to specify a separate program to be invoked from CreateProcess(). It is this separate program that will run as a child process outputting the Fibonacci sequence. Perform necessary error checking to ensure that a non-negative number is passed on the command line.
i have done with Fibonacci sequence .but i dont know how to include tht fork() function and win32 api .any one can help to finish ?
this is my c Fibonacci programme
#include<stdio.h>
int main()
{
unsigned int i=0,j=0,sum=1,num;
printf("nEnter the limit for the series ");
scanf("%d",&num);
while(sum<num)
{
printf("%d ",sum);
i=j;
j=sum;
sum=i+j;
}
getch();
}