Steps in Converting C Program to Executable Program


Programs written in high level language must be translated into machine language for execution. So, after writing C program it must go through various stages to become executable file.

Creating and executing C program requires at least four steps, now we will discuss these steps briefly :

Creating & Executing C Program Steps

  1. Create / Edit : First of all, we need to create a C program for execution. We use an editor to create or edit source program (also known as source code). C program file has extension .C (for examples: myprogram.c, hello.c, etc.)
  2. Compile : After creating or editing source code we need to compile it by using compiler. If compiler does not detect any errors in the program, then it produces object files. Object file has extension .OBJ (for examples: myprogram.obj, hello.obj, etc.). If compiler detects error in the program, then we need to return to step 1 to make correction in source code.
  3. Link : Object files are not executable file so in order to make executable file we use linker. If no errors occur, linker produces executable file having extension .EXE (for examples: myprogram.exe, hello.exe, etc.)
  4. Execute : After obtaining executing file we can run this just like other applications. We need to test to determine whether it works properly or not. If application does not work properly we need to return to step 1 for modifications.