Structure of a C Program
Every C program follows this structure:
#include <stdio.h> // 1. Preprocessor Directive
int main () { // 2. Main function – Entry point
printf(“Hello”); // 3. Statement – performs actions
return 0; // 4. Exit point of the program
}
Phases in C Program Execution:
- Editing: Writing code in an editor.
- Compiling: Compiler translates code to object files.
- Linking: Links libraries and creates executable file.
- Loading: Executable is loaded into memory.
- Execution: Code runs and produces output.
Common IDEs and Compilers:
|
Platform |
IDE/Compiler Options |
|
Windows |
Turbo C++, Code::Blocks, Dev-C++ |
|
Linux |
GCC with Terminal or VS Code |
|
Online |
OnlineGDB, Replit, Ideone |