← IGCSE Computer Science Paper 1

Executable file

The machine code program a compiler produces. It runs without the compiler or source code, needs no re-translation, and works only on the type of machine it was made for.

Understanding Executable file in IGCSE Computer Science Paper 1

What it does: The executable can be shared without the source code, which stays with the developer, so users cannot read or copy it. An executable is specific to the machine type it was compiled for. Another type of machine needs a new compile. An executable file is the machine code program that the compiler produces as its output. The code was already translated into machine code, so no re-translation is needed. An interpreter is what translates each time. The compiler is only needed to create the executable. The user can run the executable on its own.

Common mistakes: An executable file is the output of a compiler. An interpreter runs code line by line and does not produce an executable file. Line 2 should be exe <- COMPILE(source). An executable file runs on its own, so the program only needs the executable to exist. It does not need the compiler. Line 1 should check for exe, not compiler.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 430–439) and word search (Modules 419–439).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
A compiler translates source code into an executable file. What does the executable file contain?
Source codeMachine code
Matches
The user must install the compiler to run game.exe each time
↓
An executable file runs without the compiler, because it is already machine code and needs no translating again.
Applying
Meanings
Term
executable file
Meaning
The machine code program a compiler produces. It runs without the compiler or source code, needs no re-translation, and works only on the type of machine it was made for.
Practice
gcc game.c -o game.exe
Testing
Gaps
source code -> compiler -> file
Check Answer
Spots
1source <- "game.c"
2exe <- INTERPRET(source)

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Puffin' badge — Definition Diver, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. A compiler translates source code into an executable file. What does the executable file contain?
A. Source code
B. Machine code ✓
An executable file is the machine code program that the compiler produces as its output.
2. Which statement about running an executable file is correct?
A. The compiler must be installed to run it
B. The compiler is not needed to run it ✓
Once the compiler has made the executable file, the program runs on its own without the compiler.
3. Mia runs a compiled program for the second time. What happens?
A. It runs without being translated again ✓
B. It is translated again before every run
The code was already translated into machine code, so no re-translation is needed. An interpreter is what translates each time.
4. A student wants to give their finished game to friends but keep the code private. Which file should they share?
A. The executable file ✓
B. The source code file
An executable file can be given to users without sharing the source code, which keeps the code private.
5. An executable file made for a Windows PC is copied to a different type of machine with a different processor. What is likely to happen?
A. It may not run, because it is specific to one type of machine ✓
B. It will always run, because machine code works on every machine
Machine code is specific to one type of processor, so an executable file only works on the type of machine it was made for.

Match the Pairs

game.exe → An executable file: the machine code program made by a compiler that the user can run directly
gcc game.c -o game → Runs the compiler to translate the source code once and produce an executable file called game
A company gives customers only the executable file, so they can run the program without seeing the source code → Send game.exe to users. Keep game.c private.
An executable file is machine code for one type of machine, so it will not run on a different type of processor → game.exe made for a PC will not run on a phone
The user must install the compiler to run game.exe each time → An executable file runs without the compiler, because it is already machine code and needs no translating again.
game.exe is the source code, so users can read and edit it → An executable file is machine code, not source code. The source code is the separate file that the compiler translated.

Key Term

executable file
The machine code program a compiler produces. It runs without the compiler or source code, needs no re-translation, and works only on the type of machine it was made for.

Fill in the Blanks

1. source code -> compiler -> executable file
Hint: Type the name of the kind of file the compiler produces as its output.
2. An executable file contains machine code
Hint: Type the word for the instructions the CPU can run directly.
3. Run game.exe: translate again? no
Hint: Type the answer to whether the program must be translated again before it runs.
4. Give users the .exe, keep the source code
Hint: Type the word for the original program text that the developer does not need to share.
5. An executable file is specific to one type of machine
Hint: Type the word for what the executable file is tied to, such as a particular processor or computer.

Spot the Error

Question 1
A source <- "game.c"
B exe <- INTERPRET(source)
C OUTPUT "Build finished"
Line B — An executable file is the output of a compiler. An interpreter runs code line by line and does not produce an executable file. Line 2 should be exe <- COMPILE(source).
Question 2
A IF compiler EXISTS THEN
B RUN exe
C ENDIF
Line A — An executable file runs on its own, so the program only needs the executable to exist. It does not need the compiler. Line 1 should check for exe, not compiler.
Question 3
A exe <- COMPILE(source)
B SEND exe TO customer
C SEND source TO customer
Line C — An executable can be given to users without sharing the source code. Sending the source code defeats this. Line 3 should keep the source private.
Question 4
A source <- COMPILE(exe)
B RUN exe
C OUTPUT "Done"
Line A — The compiler takes the source code as input and produces the executable file as output. The line has them the wrong way round. It should be exe <- COMPILE(source).
Question 5
A exe <- COMPILE(source, "PC")
B RUN exe ON "Phone"
C OUTPUT "Works"
Line B — An executable is machine code for one type of machine only. One compiled for a PC will not run on a phone, which has a different processor. Line 2 should run it on a PC.

Student with a class code? Join your class →