369 TESLAKALVIYOGI
Page 15 of 30

Compile Time vs Runtime

Simple difference with classroom example

</> logic
1

Concept Meaning

Compile time happens before the program runs. Runtime happens while the program is running.

2

Real-Life Analogy

Teacher checking homework before class is like compile time. Student answering during class is like runtime.

3

Expected Output

Compile first, run next.
4

Common Mistake

Do not confuse code checking before run with output during run.

Same Logic • Different Syntax

Code in 4 Languages

JavaScript
console.log("Runtime output");
C++
g++ program.cpp -o program
./program
Python
python program.py
PHP
<?php echo "Runtime output"; ?>

Memory Tip

Compile time = before run. Runtime = during run.