A dynamic variable is a variable whose address is determined when the program is run. In contrast, a static variable has memory reserved for it at compilation time.
Dynamic variables provide flexibility. I mean that in dynamic variables, we do not have to mention the data type of variables at compile time, it can be decided by compiler on the basis of input values.
For example: Python, JavaScript etc have facility of dynamic variables.