GATE 2012 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2012

82 questions

MCQ 821-mark 39 · 2-mark 43

Questions 26–30 of 82

Q26Pipeline Processor1 markMCQ−0.33 if wrong
Register renaming is done in pipelined processors

Q27Conditional Statement1 markMCQ−0.33 if wrong
What will be the output of the following C program segment?
 char inChar = 'A' ;
switch ( inChar ) {
case 'A' : printf ("Choice A\n") ;
case 'B' :
case 'C' : printf ("Choice B") ;
case 'D' :
case 'E' :
default : printf ( " No Choice" ) ; } 

Q28Function2 marksMCQ−0.67 if wrong
Consider the following C code segment.

int a, b, c = 0;
void prtFun(void);
main( )
{ static int a = 1; /* Line 1 */
   prtFun( );
   a += 1;
   prtFun( );
   printf(" \n %d %d ", a, b);
}
void prtFun(void)
{ static int a = 2; /* Line 2 */
   int b = 1;
   a += ++b;
   printf(" \n %d %d ", a, b);
}
What output will be generated by the given code segment if:

Line 1 is replaced by auto int a = 1;
Line 2 is replaced by register int a = 2;

Q29Function2 marksMCQ−0.67 if wrong
Consider the following C code segment.

int a, b, c = 0;
void prtFun(void);
main( )
{ static int a = 1; /* Line 1 */
   prtFun( );
   a += 1;
   prtFun( );
   printf(" \n %d %d ", a, b);
}
void prtFun(void)
{ static int a = 2; /* Line 2 */
   int b = 1;
   a += ++b;
   printf(" \n %d %d ", a, b);
}
What output will be generated by the given code segment?

Q30Queue2 marksMCQ−0.67 if wrong
Suppose a circular queue of capacity (n-1) elements is implemented with an array of n elements. Assume that the insertion and deletion operations are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are