Question: what is the difference between static and dynamic variables?
Answer: A static variable can be thought of as a variable that is allocated in memory for the lifetime of during program execution. ... A dynamic variable is a variable that can hold any value provided by the user during any program execution. Every time, new memory space is allocated for such a variable.