Home / C Programming / Expressions :: Discussion

Discussion :: Expressions

  1. Which of the following are unary operators in C?

    1. !
    2. sizeof
    3. ~
    4. &&

  2. A.
    1, 2
    B.
    1, 3
    C.
    2, 4
    D.
    1, 2, 3

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    An operation with only one operand is called unary operation.
    Unary operators:
    ! Logical NOT operator.
    ~ bitwise NOT operator.
    sizeof Size-of operator.

    && Logical AND is a logical operator.

    Therefore, 1, 2, 3 are unary operators.


Be The First To Comment