engineering computer science MCQ #2146

What is the effect of `const int x = 5; x = 10;`?

engineering computer science MCQ #2146

  1. Question 1

    Q1. What is the effect of `const int x = 5; x = 10;`?

    • A) x is reassigned to 10
    • B) x remains 5
    • C) Compilation error
    • D) Runtime error

    Answer: Compilation error

    Explanation: Assigning to a const variable results in a compilation error. NET computer science MCQs often test this core concept.