Question: Write the output of the following C program that uses process system calls int main(void) { } int pid, status, lcm=0; pid= fork(); if

Write the output of the following C program that uses process system calls int main(void) { } int pid,

Write the output of the following C program that uses process system calls int main(void) { } int pid, status, lcm=0; pid= fork(); if (pid=-1){ printf("error"); exit(1); } if (pid=0){ execl("./a.out","a.out","35","23","32",(char*)NULL); //a.out is an executable file which does LCM of the numbers given as arguments and prints on screen printf("Product of Numbers: %f ",lcm), } else printf("status = %d ",status); wait(&status);

Step by Step Solution

3.52 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The output of the program will be status 0 Product of Numbers 1071... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Network Questions!