Assume that a folder contains the four files main.c, hello.c, main, and hello. Here main.c and hello.c contain the following source code. main and hello are executable files of main.c and hello.c respectively. In this case, write the output generated after the execution of "main.c"?
Ans.)
main.c *hello.c*/
#include<stdio.h>
#include<unistd.h>
#include<stdio.h>
int mainO
#include<unistd.h>
#include<stdlib.h>
char args=hello0,0 NULLJ:
int main(int argc, char* argv) {
pid_t pid = vfork();
if(vfork() == 0) {
vfork();
if(pid == 0)
printf("P print");
else
printf("C");
exit(0);
}
print("P");
execv("Shello", args);
printf("R");
print("F");
return 0;
}