1
GATE CSE 2004
MCQ (Single Correct Answer)
+1
-0.3
Consider the following statements with respect to user-level threads and kernel-supported threads.
i) Context switch is faster with kernel- supported threads
ii) For user-level threads, a system call can block the entire process
iii) Kernel-supported threads can be scheduled independently
iv) Use-level threads are transparent to the kernel

Which of the above statements are true?

A
(ii), (iii) & (iv) only
B
(ii) & (iii) only
C
(i) & (iii) only
D
(i) & (ii) only
2
GATE CSE 2004
MCQ (Single Correct Answer)
+2
-0.6
Consider the following C program segment:
char p[20];
char *s = "string";
int length = strlen(s);
for(i=0; i < length; i++)
  p[i] = s[length-i];
printf("%s",p);
The output of the program is
A
gnirts
B
string
C
gnirt
D
no output is printed
3
GATE CSE 2004
MCQ (Single Correct Answer)
+1
-0.3
Consider the following C function:
void swap (int a, int b)
{
   int temp;
   temp = a;
   a = b;
   b = temp;
}
In order to exchange the values of two variables x and y.
A
call swap (x, y)
B
call swap (&x, &y)
C
swap (x, y) cannot be used as it does return any value
D
swap (x, y) cannot be used as the parameters are passed by value
4
GATE CSE 2004
MCQ (Single Correct Answer)
+2
-0.6
Consider the following C program
main ( )
{
  int x, y, m, n;
  scanf("%d %d", &x, &y);
  /* Assume x > 0 and y > 0 */
  m=x; n=y;
  while(m!=n)
  {
    if(m>n)
    m=m-n;
    else
    n=n-m;
  }
  printf("%d", n);
}
The program computes
A
x + y using repeated subtraction
B
x mod y using repeated subtraction
C
the greatest common divisor of x and y
D
the least common multiple of x and y
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