 |
| Necessary Steps to prepare a C program for Execution |
The following necessary steps are taken to prepare a C
program for execution:-
- Creating & Editing C program
- Saving C program
- Compiling c program
- Linking c Program
- Loading c Program
- Executing c program
Creating & Editing
C program
The first step is to create and edit the source program in
C. the C program is usually written and edited in turbo C/C++ editor.
Saving C program
After writing or editing the source program, it is saved on
the disk. The extension of the file must be “C”.
Compiling C program
In this step, the source program is compiled. The source
program is converted into machine code. The C-compiler is used to translate the
program source code into the machine code. After compiling source code, an
object file with extension obj is created.
Linking C program
In this step, the linker object file to the required library
files. After linking object code to the libraries, an executable file with
extension exe is created.
Loading c program
In this step, the loader loads the executable file from disk
into memory for execution. The program must be loaded into memory for
execution.
Executing C Program
In this step, the program is executed on the computer. The
cpu fetches instructions of program from memory one by one and takes action on
them.
A diagram is show below which show the necessary steps that
are taken to prepare a c program for execution.
No comments: