Volatile variable:
Variables prefixed with the keyword volatile acts as a data type qualifier. The volatile keyword attempts to alter the default way in which the variables are stored and the way the compiler handles the variables.
It is a kind of instruction to the optimizer to not to optimize the variables during compilation.