in Operating System edited by
761 views
0 votes
0 votes
void main()
{
int n = 1;

if(fork()==0)
  {
    n = n<<1;
    printf(“%d, “, n);
    n = n <<1;
  }
if(fork()==0)

    n=n+700;

    printf(“%d, “,n);

}


Which of the following output is not possible?

  1. 2,4,1,701,704
  2. 1,2,4,704,701
  3. 2,704,4,701,1
  4. 1,704,2,4,701
in Operating System edited by
761 views

1 comment

Option d, as program will print 2 before 704 which is contradicted by option d.
0
0

1 Answer

0 votes
0 votes

 

As all five values are possible .

Due to context switch every option is Possible.

So i think none is wrong.

1 comment

I think all combinations should be possible so none is wrong.

0
0

Related questions