What is the output of following code?
#include <stdio.h>
#include <unistd.h>
int main()
{
if (fork()) {
if (!fork()) {
fork();
printf("1 ");
}
else {
printf("2 ");
}
}
else {
printf("3 ");
}
printf("4 ");
return 0;
}
What is the output of following code?
#include <stdio.h>
#include <unistd.h>
int main()
{
if (fork()) {
if (!fork()) {
fork();
printf("1 ");
}
else {
printf("2 ");
}
}
else {
printf("3 ");
}
printf("4 ");
return 0;
}
* השאלה נוספה בתאריך: 20-07-2020