compiler changes checks your source code for errors and changes it into object code.this is the code that operating system runs.
You often don't write a whole program in single file so linker links all your object code files.
your program wont get executed unless it is in main memory