Follow the steps to execute apex code in developer console. Now go to Debug=>Open execute anonymous window. Use CTRL + E shortcut to open window to execute apex code. Now click on execute button.