Question 1
What does the following program do when the input is unsigned 16-bit integer?
#include
main( )
{
unsigned int num;
int i;
scanf (“%u”, &num);
for ( i = 0; i<16; i++)
{
printf (“%d”, (num << i & 1 << 15 ) ? 1:0);
}
}
It prints all even bits from num
It prints all odd bits from num
It prints binary equivalent of num
None of the above
Question 2
What is the output of the following program?
main( )
{
int a = 10;
if ((fork ( ) == 0))
a++;
printf (“%d\\n”, a );
}
10 and 11
10
11
11 and 11
Question 3
Mutual exclusion problem occurs
Between two disjoint processes that do not interact
Among processes that share resources
Among processes that do not use the same resource
Between two processes that uses different resources of different machine
Question 4
A critical region
is a piece of code which only one process executes at a time
is a region prone to deadlock
is a piece of code which only a finite number of processes execute
is found only in windows NT operating system
Question 5
At particular time, the value of a counting semaphore is 10, it will become 7 after: (a) 3 V operations (b) 3 P operations (c) 5 V operations and 2 P operations (d) 2 V operations and 5 P operations Which of the following option is correct?
Only (b)
Only(d)
Both (b) and (d)
None of these
Question 6
An Ethernet frame that is less than the IEEE 802.3 minimum length of 64 octets is called
Short frame
Small frame
Mini frame
Runt frame
Question 7
The best data structure to check whether an arithmetic expression has balanced parenthesis is a
Queue
Stack
Tree
List
Question 8
The time complexity of computing the transitive closure of a binary relation on a set of n elements is known to be
O(n*log(n))
O(n3/2)
O(n3)
O(n)
Question 9
What does the following C-statement declare? int (*f) (int*);
A function that takes an integer pointer as argument and returns an integer
A function that takes an integer as argument and returns an integer pointer
A pointer to a function that takes an integer pointer as argument and returns an integer
A function that takes an integer pointer as argument and returns a function pointer
Question 10
Consider the following C function
void swap ( int x, int y )
{
int tmp;
tmp = x;
x= y;
y = tmp;
}
In order to exchange the values of two variables a and b:
Call swap (a, b)
Call swap (&a, &b)
swap(a, b) cannot be used as it does not return any value
swap(a, b) cannot be used as the parameters passed by value
There are 78 questions to complete.