Question 1
P1 P2
if (a < 0) b = 10;
c = b-a; a = -3;
else
c = b+a;
If the processes P1 and P2 executes concurrently (shared variables a, b and c), which of the following cannot be the value of ‘c’ after both processes complete?
Question 2
Question 3
O(n2)
O(k2)
Question 4
Question 5
Question 6
Question 7
int main()
{
int array[5][5];
printf("%d",( (array == *array) && (*array == array[0]) ));
return 0;
}
Question 8
int main()
{
int a = 300;
char *b = (char *)&a;
*++b = 2;
printf("%d ",a);
return 0;
}
Consider the size of int as two bytes and size of char as one byte. Predict the output of the following code .
Assume that the machine is little-endian.Question 9
Question 10
There are 65 questions to complete.