logo

Crowdly

Predict the output of the program given here. Assume that all the path names f...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Predict the output of the program given here.

Assume that all the path names for the programs are correct. For example "/usr/bin/echo" will actually run echo command.

Assume that there is no mixing of printf output on screen if two of them run concurrently.

In the answer replace a new line by a single space.

For example::

good

output

should be written as good output

--

main() {

    int i;

    i = fork();

    if(i == 0)

        execl("/usr/bin/echo", "/usr/bin/echo", "hi", 0);

    else

        wait(0);

    fork();

    execl("/usr/bin/echo", "/usr/bin/echo", "one", 0);

}

More questions like this

Want instant access to all verified answers on moodle.coep.org.in?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!