1. Question: Which of the following is a compound assignment operator?

    A
    =+

    B
    +=

    C
    ==

    D
    !=

    Note: Compound assignment operators perform an operation and assignment in one step.
    1. Report
  2. Question: What does the << operator do?

    A
    Performs bitwise left shift

    B
    Performs bitwise right shift

    C
    None

    D
    Both

    Note: The << operator shifts bits to the left, effectively multiplying the number.
    1. Report
  3. Question: What is the output of 0 | 1?

    A
    1

    B
    0

    C
    2

    D
    3

    Note: The bitwise OR operation results in 1 (binary 00 | 01 = 01).
    1. Report
  4. Question: What does 5 > 3 && 2 < 4 evaluate to?

    A
    true

    B
    false

    C
    null

    D
    error

    Note: Both conditions are true, making the result true.
    1. Report
  5. Question: Which operator checks if two operands are not equal?

    A
    !=

    B
    ==

    C
    =!=

    D
    <>

    Note: The != operator checks for inequality.
    1. Report
  6. Question: What does b >>= 1 do?

    A
    Divides b by 2 and assigns the result to b

    B
    Multiplies b by 2 and assigns the result to b

    C
    None

    D
    Both

    Note: The right shift operator divides the value by 2 for each shift.
    1. Report
  7. Question: What is the result of 3 + 4 * 2?

    A
    14

    B
    10

    C
    11

    D
    9

    Note: The multiplication operator has higher precedence than addition.
    1. Report
  8. Question: What does a |= b do?

    A
    Adds b to a

    B
    Performs bitwise OR and assigns the result to a

    C
    Sets a to b

    D
    None

    Note: This is a compound assignment operator that combines bitwise OR with assignment.
    1. Report
  9. Question: What will 3 | 1 evaluate to?

    A
    1

    B
    2

    C
    3

    D
    4

    Note: The bitwise OR results in 3 (binary 11 | 01 = 11).
    1. Report
  10. Question: What does the ^ operator do?

    A
    Bitwise OR

    B
    Bitwise XOR

    C
    Logical AND

    D
    None

    Note: The ^ operator returns 1 for differing bits.
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd