1
GATE CSE 2008
MCQ (Single Correct Answer)
+2
-0.6
The P and V operations on counting semaphores, where s is a counting semaphore, are defined as follows:

P(s): s = s-1; 
if s < 0 then wait; 
V(s) : s = s-1; 
ifs <= 0 then wakeup a process waiting on s;
Assume that Pb and Vb the wait and signal operations on binary semaphores are provided. Two binary semaphores Xb and Yb are used to implement the semaphore operations P(s) and V(s) as follows:

  P(s): Pb (Xb);
        S = s - 1;
        if(s < 0){
          Vb(Xb);
          Pb(Yb);
        }
        Else Vb (Xb);
  V(s): Pb (Xb);
        S = s + 1;
        if(s <= 0) Vb(Yb);
        Vb(Xb);
The initial values of Xb and Yb are respectively
A
0 and 0
B
0 and 1
C
1 and 0
D
1 and 1
2
GATE CSE 2008
MCQ (Single Correct Answer)
+2
-0.6
Which of the following is/are true of the auto-increment addressing mode?
$${\rm I}.\,\,\,$$ It is useful in creating self-relocating code
$${\rm II}.\,\,\,$$ If it is included in an Instruction Set Architecture, then an additional $$ALU$$ is required for effective address calculation.
$${\rm III}.\,\,\,$$ The amount of increment depends on the size of the data item accessed
A
$${\rm I}$$ only
B
$${\rm II}$$ only
C
$${\rm III}$$ only
D
$${\rm II}$$ & $${\rm III}$$ only
3
GATE CSE 2008
MCQ (Single Correct Answer)
+2
-0.6
A process executes the following code
for (i = 0; i < n; i + +) fork ( ); 
The total number of child processes created is
A
$$n$$
B
$${2^n} - 1$$
C
$${2^n}$$
D
$${2^{n + 1}} - 1$$
4
GATE CSE 2008
MCQ (Single Correct Answer)
+2
-0.6
What is printed by the following C program?
#include < stdio.h >
int f(int x, int *py, int **ppz)
{
   int y, z;
  **ppz += 1; 
   z  = **ppz;
  *py += 2;
   y = *py;
   x += 3;
   return x + y + z;
}
 
void main()
{
   int c, *b, **a;
   c = 4;
   b = &c;
   a = &b; 
   printf( "%d", f(c,b,a));
   getchar();
}
A
18
B
19
C
21
D
22
EXAM MAP
Medical
NEETAIIMS
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
Staff Selection Commission
SSC CGL Tier I
CBSE
Class 12