The accurate answer is
A compiler takes your source code, it converts the entire thing into machine language and then stores these equivalent machine language instructions in a separate file. We programmers call that the "executable file.
Glad to help :)