31. The value of 3^{51} mod 5 is ________.

- Option : B
- Explanation :

According to chinese remainder theorem:

= 3^{51}mod 5

= (3^{3})^{17}mod 5

= (27)^{17}mod 5

= {(2^{2})^{8}*2^{1}} mod 5

= {(4)^{8}*(2)} mod 5

= {(-1)^{8}*(2)} mod 5

= {(1*2)} mod 5

= {(2)} mod 5

= 2

You must be logged in to post a comment.

- Option : A
- Explanation :

The 4-bit binary representation of numbers (1, 2, 3, 4………13):

0 - 0000

1 - 0001

2 - 0010

3 - 0011

4 - 0100

5 - 0101

6 - 0110

7 - 0111

8 - 1000

9 - 1001

10 - 1010

11 - 1011

12 - 1100

13 - 1101

There 6 numbers which start with MSB as 1, and 7 numbers which start with MSB as 0.

Therefore, probability that their 4-bit binary representations have the same most significant bit is,

= P(MSB is 0) + P(MSB is 1)

= (7×7)/(13×13) + (6×6)/(13×13)

= (49+36)/169

= 85/169

= 0.5029

Option (A) is correct.

You must be logged in to post a comment.

You must be logged in to post a comment.

34. Consider the following C program:

int main(){int arr[]={1,2,3,4,5,6,7,8,9,0,1,2,5},

*ip=arr+4;

printf(“%d\n”, ip[1]);

return 0;

}

The number that will be displayed on execution of the program is ___________ .

Note – Numerical Type question

- Option : A
- Explanation :

Initially ip pointer is pointing at (arr+4) or skipping starting first 4 position.

Now in the printf system call, 1 more position is to skip, So it will point to (arr+5) or skip 5 position from starting:

Hence, printf will print value at 6th position, i.e., 6 will printed.

So, option (A) is correct.

You must be logged in to post a comment.

You must be logged in to post a comment.

35. Consider a sequence of 14 elements: A = [−5, −10, 6, 3, −1, −2, 13, 4, −9, −1, 4, 12, −3, 0].

Note – Numerical Type question

- Option : A
- Explanation :

According to largest Sum Contiguous subarray is from index 2 to 11,

Max (S(i, j))

= S(2, 11)

= 6 + 3 + (-1) + (-2) + 13 + 4 + (-9) + (-1) + 4 + 12

= 29

So, answer is 29.

You must be logged in to post a comment.

You must be logged in to post a comment.

You must be logged in to post a comment.