Static vs Dynamic Memory allocation

Memory is divided into small addressable units called bytes, and each byte has its own linear address. The number of bytes depends on the…