1. Question: Which operator would you use to perform a logical negation?

    A
    &

    B
    |

    C
    !

    D
    ~

    Note: The ! operator negates a boolean value.
    1. Report
  2. Question: What does a %= b do?

    A
    Assigns the remainder of a divided by b to a

    B
    Subtracts b from a

    C
    Adds b to a

    D
    None

    Note: This is a compound assignment operator.
    1. Report
  3. Question: What is the output of true && true || false?

    A
    true

    B
    false

    C
    null

    D
    error

    Note: The logical AND is evaluated first, resulting in true, which then evaluates to true with the OR.
    1. Report
  4. Question: Which operator performs a bitwise AND operation?

    A
    &&

    B
    &

    C
    |

    D
    ||

    Note: The & operator performs a bitwise AND operation on two integral types.
    1. Report
  5. Question: Which operator is used to perform a ternary conditional operation?

    A
    &&

    B
    ? :

    C
    if

    D
    switch

    Note: The ternary operator allows for shorthand conditional expressions.
    1. Report
  6. Question: What does x != y check?

    A
    If x is less than y

    B
    If x is greater than y

    C
    If x is equal to y

    D
    If x is not equal to y

    Note: != operator checks for inequality.
    1. Report
  7. Question: What is the result of 10 % 3?

    A
    1

    B
    2

    C
    0

    D
    3

    Note: The modulo operator returns the remainder of the division.
    1. Report
  8. 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
  9. 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
  10. 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
Copyright © 2025. Powered by Intellect Software Ltd