Which keyword is used to declare a variable that is intended to be immutable?
Explanation
The correct answer is (b) const.
Explanation
In C and C++, the const keyword is used to qualify a variable as immutable, meaning its value cannot be modified after it has been initialized. This is a crucial concept for ensuring data integrity and preventing accidental changes to values that should remain constant throughout the program's execution.
Conceptual Mathematical Model
If we define a mutable variable V that can change over time, the value at time t1 does not necessarily equal the value at time t2:
V(t1)=V(t2)
However, if we declare a variable using the const keyword, we enforce the property of immutability, ensuring that the value remains constant for all time t:
Const_Variable(t1)=Const_Variable(t2)