As we discussed before, variables hold different values, but in some cases, we need to declare a variable as read-only and unchangeable. To do this, we are required to use the const keyword before the variable type. Look at the following example to understand C constants:
const int temp = 18
// temp will always be 18 and cannot be changed
If I try to change temp, I would get an error:
temp = 25;
//error: assignment of read-only variable 'temp'
Hands-on practice: try this on your computer and see the result.
const int temp;
temp = 15; //error