Tag: programming languages

Questions Related to programming languages

  1. -231 to 231 - 1

  2. -232 to 232 - 1

  3. -264 to 264

  4. -263 to 263 - 1


Correct Option: D

27 | 8 = ?

  1. 19

  2. 8

  3. 27

  4. 35


Correct Option: C

Consider the following code: int x, y, z; y = 1; z = 5; x = 0 - (++y) + z++; After execution of this, what will be the values of x, y and z?

  1. x = 4, y = 2, z = 6

  2. x = 3, y = 2, z = 6

  3. x = 4, y = 1, z = 5

  4. x = -7, y = 1, z = 5


Correct Option: B

What will be the result of the expression a % b when a and b are of type int and their values are a = -17 and b = -6?

  1. 5

  2. -5

  3. -23

  4. None of these


Correct Option: A

Which of the following is not a hexadecimal number? (A) 999 (B) (hex)23 (C) 0x556 (D) 0x1F2

  1. (A), (B) & (C)

  2. (A) & (B)

  3. (A)

  4. (C)


Correct Option: B

AI Explanation

To answer this question, you need to understand hexadecimal numbers. Hexadecimal numbers are base-16 numbers that use the digits 0-9 and the letters A-F to represent values from 0 to 15.

Let's go through each option to understand why it is correct or incorrect:

Option A) 999 - This option is a decimal number because it uses the digits 0-9 only. Decimal numbers are base-10 numbers.

Option B) (hex)23 - This option is a hexadecimal number because it uses the prefix "(hex)" and the digits 0-9 and A-F.

Option C) 0x556 - This option is a hexadecimal number because it uses the prefix "0x" and the digits 0-9 and A-F.

Option D) 0x1F2 - This option is a hexadecimal number because it uses the prefix "0x" and the digits 0-9 and A-F.

The correct answer is B) (A) & (B). Option A (999) is a decimal number, and Option B ((hex)23) is a hexadecimal number. Therefore, they are not hexadecimal numbers.

So, the correct answer is B) (A) & (B).

If not assigned a value, a variable of type char has the following default value:

  1. '\uffff'

  2. '\u0001'

  3. '\u0000'

  4. " " (space)


Correct Option: C

By which keyword Boolean data type is expressed in C++?

  1. boolean

  2. boo

  3. bolean

  4. bool


Correct Option: D