Question: How many times will the message Hello!n be displayed? int a = 0; int main() { int pid1= fork(); a++; int pid2= fork(); a++;

How many times will the message "Hello!n" be displayed? int a =

0; int main() { int pid1= fork(); a++; int pid2= fork(); a++;  

How many times will the message "Hello!n" be displayed? int a = 0; int main() { int pid1= fork(); a++; int pid2= fork(); a++; if (pid1 == || pid2=%30) { printf(Hello! "); } else { printf ("Goodbye! "); } a++; printf("a is %d ", a);

Step by Step Solution

3.26 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

3 times Hello will be printed Output Hello will be printed 3 times and Goodbye will be printed ... 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 Operating System Questions!