engineering computer science MCQ #2165

What is the output of `int x = 5; printf('%d', ~x)`?

engineering computer science MCQ #2165

  1. Question 1

    Q1. What is the output of `int x = 5; printf('%d', ~x)`?

    • A) -6
    • B) -5
    • C) -4
    • D) Error

    Answer: -6

    Explanation: Bitwise NOT operation: ~5 = -6 (two's complement representation). NET computer science MCQs often test this core concept.