34,333
edits
Changes
→What is a C# Constant?
<pre>
const int interestRate = 10;
</pre>
Note that a constant, unlike a variable, must be initialized at the point that it is declared. For example, the follwoing code:
<pre>
const int interestRate;
</pre>
will result in a compilation error along the lines of ''A const field requires a value to be provided''.