---
title: "Source code versus object code"
subject: "Computer Programming"
chapter: 1
key: "semester_1/computer_programming:source-vs-object-code"
source: https://www.bctengineer.com/q/semester_1/computer_programming/source-vs-object-code
site: BCT Engineering
---

# Source code versus object code

Computer Programming · Chapter 1: Overview of computer software & programming languages

- Asked in: 2074 Chaitra, 2 marks
- Video: [source code vs Object code || C-Programming || Lecture 4](https://www.youtube.com/watch?v=LZSl5yPa-ik) — Erum iftikhar
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_1/computer_programming/source-vs-object-code
- Whole chapter: https://www.bctengineer.com/md/semester_1/computer_programming/chapter-1

## Question

What is the difference between source code and object code?

## Short answer

Source code is the human-readable program written by a programmer in a high-level or assembly language. Object code is the machine-language binary output generated by a compiler or assembler, which is not human-readable and is specific to one CPU and OS.

## Answer

**Source code** is the program written by the programmer in a high-level or assembly language. **Object code** is the machine-language output produced when the compiler translates the source code.

| Source code | Object code |
|---|---|
| Written by the programmer | Generated by the compiler/assembler |
| Human readable text (`.c`, `.cpp`) | Binary, not readable (`.obj`, `.o`) |
| Input to the compiler | Input to the linker |
| Portable to other machines | Specific to one CPU and OS |
| Can be edited directly | Cannot be edited meaningfully |

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Source code is
   A. binary output of the compiler
   B. the executable file
   C. the program written by the programmer in a high-level or assembly language
   D. the linker's output
   Answer: C. Source code is human-written; object code is compiler output. (Key point: Source code)

2. Which is true of object code?
   A. It is human readable and portable
   B. It is written by the programmer
   C. It is directly edited as text
   D. It is specific to one CPU and OS and is input to the linker
   Answer: D. Object code is binary, machine specific and goes to the linker. (Key point: Object code)

3. Which file extensions suit source and object code respectively?
   A. .c and .obj
   B. .obj and .c
   C. .exe and .c
   D. .c and .txt
   Answer: A. Source is .c/.cpp; object is .obj/.o. (Key point: File types)

## Related in Computer Programming

- [Algorithm versus pseudo-code](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Aalgorithm-vs-pseudocode) — Computer Programming, chapter 2
- [do...while versus for/while loops](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Ado-while-vs-for-while) — Computer Programming, chapter 5, asked 2×
- [Variable declaration versus definition](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Adeclaration-vs-definition) — Computer Programming, chapter 3

## Related in other subjects

- [Distributed object versus multiprocessor architecture](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Adistributed-object-vs-multiprocessor) — Software Engineering, chapter 3
- [Huffman code for seven-symbol source](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Ahuffman-seven-symbols) — Communication Systems, chapter 6
- [Image space versus object space methods](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Aimage-space-vs-object-space) — Computer Graphics, chapter 7, asked 9×
- [Client-server versus distributed object architecture](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Aclient-server-vs-distributed-object) — Software Engineering, chapter 3
