Semua buku

Profesional

Aplikasi Tentang Pelatih Masuk Mulai membaca

Computer Science · Glosarium

Apa itu Value and variable?

Dikenal juga sebagai: value · variable

Definition 15.1 Primary & Middle School Computer Science · Bab 15 — Variables and Input

A value is a piece of data a program works with: a number such as 25 or 2.5, or a text such as "Noor". A variable is a name that a program gives to a value, to keep it and use it later.

Contoh

Example 15.6 (Tracing five lines)

A dash means that the variable has no value yet.

lineinstructionab
1a = 55–
2b = a + 358
3a = b * 2168
4b = b - a16−8-8
5print(a, b)16−8-8

The program should print 16 -8. Running it confirms the table:

Baca dalam konteks →