Answer: Option [D]

This site is dedicated to the aspirants of competitive exams SSC, UPSC, Railways, Bank, GATE and NET

Questions

16
An expression contains relational, assignment and arithmetic operators. If parenthesis are not specified, the order of evaluation of the operators would be:

Answer: Option [D]

17
Given two literals 0x001B and 033. What are these equal to?

Answer: Option [D]

Let us convert the given Hexadecimal number 0x001B to Decimal:

The first part is 0x16^{0}=0

The second part is 0x16^{3}+0x16^{2}+1x16^{1}+11x16^{0} [Though B is equivalent to 11]

=27

So, 0+27=0

Now we convert the octal number 033 to decimal:

0x8^{2}+3x^{1}+3^{0}

=27

18
What is the output of the following code segment(assuming sizeof(int) returns 4)?

int i=0x1 << sizeof(int)*8-1; printf("\n%x",i); i=i>>sizeof(int)*8-1; printf("%d",i);

Answer: Option [B]

20
Which is the correct sequence statements that swaps values of two statements?

Answer: Option [B]

Let us test this with an example:

Let, a=20 and b=40. After swapping them a=40 and b=20

a=a+b; a=20+40=60;

b=a-b; 60-40=20;

a=a-b; 60-20=40;