Constants are the value that can not be changed after assigning them. If we created a constant, then there is no way of changing its value. The keyword for declaring constant is const. In Rust, constants must be explicitly typed. The below syntax is used to initialize a constant value:
const VARIABLE_NAME:dataType = value;
Now let’s check out some examples for the same.
Example 1 :
MARKS 100 PI 3.14 NAME GFG
This will produce an error :