Home » C Programming » Difference Between Source Code, Object Code and Executable Code

Difference Between Source Code, Object Code and Executable Code

✍️
Source Code
Written by programmer in a high-level language (C, C++, Python).
Human-readable but not directly executable.
printf(“Hello World”);
⚙️
Object Code
Machine-readable code generated by compiler.
Stored in .obj / .o files.
Not directly executable.
▶️
Executable Code
Final program created by the linker.
Can be directly executed by computer.
Example: .exe (Windows), a.out (Linux)

Source Code ➡️ Compiler ➡️ Object Code ➡️ Linker ➡️ Executable Code

Feature Source Code Object Code Executable Code
Meaning Program written by programmer in high-level language. Machine-readable code generated after compilation. Final runnable program created after linking with libraries.
Readability Human-readable Not human-readable Not human-readable but directly runnable
File Type .c, .cpp, .java, .py .obj, .o .exe (Windows), a.out (Linux)
Execution Cannot be executed directly Cannot be executed directly Can be executed directly by computer
Created By Programmer Compiler Linker
Example printf(“Hello World”); Compiled binary of above code HelloWorld.exe → prints “Hello World”
📢 Yeh video dekhte waqt aap important points note kar sakte ho!

Leave a comment

Your email address will not be published. Required fields are marked *