Write a program to simulate Memory Management for First-Fit.

(Memory Management): Write a program to simulate Memory Management for First-Fit.a.Define 10 element array and mark as 0 (0 means free memory)b.Repeat the following steps until exitc.Display a menu to ask user to create, delete, or exitFor creation:1.Assign a process number (staring 1 and increase by 1 for each creation)2.Generate a random number between 1 and 4 (means the memory needed by this process)3.Assign the process number to required memory location by using First-Fit (means that memory location used by that process)4.Display the contents of the arrayFor deletion:5.Ask user to input process number6.If the process exists, delete the memory by assign 0 to those location and display the contents of the array7.If the process does not exist, display error message.