C language में constant का उद्देश्य क्या है?
What is the purpose of constant in C language?
A
Variable को बदलने के लिए
B
Value को fix रखने के लिए
C
Memory save करने के लिए
D
Program को slow करने के लिए
Explanation
C language में const keyword का उपयोग किसी variable की value को constant (स्थिर) बनाने के लिए किया जाता है।
एक बार value assign हो जाने के बाद, उसे बदला नहीं जा सकता।
🧪 उदाहरण / Example:
const int maxValue = 100;
maxValue = 200; // ❌ Error! क्योंकि यह एक constant है
👉 So, constant का उद्देश्य होता है किसी वैल्यू को fix (स्थिर) रखना।
👉 The purpose of a constant is to prevent its value from being changed.
Correct Answer: B) Value को fix रखने के लिए