Skip to content

Beta · Data may be lost.Your data may be reset or lost.

GateBrew
← GATE CSE 2024 Set 1
Questions

Q47

NAT2 marksOperating systems

Consider the following code snippet using the fork () and wait () system calls. Assume that the code compiles and runs correctly, and that the system calls run successfully without any errors.

int x=3;
while (x>0){
    fork ();
    printf("hello");
    wait (NULL) ;
    X-- ;
}

The total number of times the printf statement is executed is __________.

Sign in to save attempts.

The solution is hidden while you attempt this question. It opens once you check or show the answer.