5 exercises on saying arithmetic and conditional operators aloud.
0 / 5 completed
1 / 5
How is the "*" symbol read when used as a multiplication operator?
The character * is named the asterisk, but when read as an arithmetic operator developers usually say "star" or "times". So a * b is "a times b" or "a star b". In other contexts "*" has other names: a pointer in C (int *p = "int star p"), a wildcard in a glob (*.js = "star dot jay-ess"), or multiplication. "Asterisk" is the formal character name; "star" and "times" are the common spoken forms. Avoid "multiply-sign" in casual speech.
2 / 5
How is the division operator "/" most commonly read aloud in code?
The character / is the (forward) slash, read as "slash" or, as an arithmetic operator, "divided by". So a / b is "a slash b" or "a divided by b". Crucially, distinguish it from the backslash "\" ("back-slash"), used in Windows paths and escape sequences. Reading a URL, "/" is always "slash" (https:// = "h-t-t-p-s colon slash slash"). Confusing slash and backslash is a classic dictation error, so name them explicitly.
3 / 5
How is the modulo operator "%" read aloud in a programming context?
The character % is the percent sign, but as the remainder/modulo operator it is usually read "mod" or "modulo". So a % b is "a mod b" or "a modulo b" — meaning the remainder of a divided by b. In a printf format string or a literal percentage you would instead say "percent" (%d = "percent d"). Context decides: as an operator it is "mod"; as a character or format specifier it is "percent". Both are correct names for the same glyph.
4 / 5
How is the exponentiation operator "**" (as in Python a ** b) read aloud?
The operator ** (exponentiation in Python, JavaScript and others) is read as "star star", "to the power of", or simply "power". So a ** b is "a to the power of b" or "a star-star b". Informally the single "*" is sometimes called a "splat" (especially in Ruby/Python argument unpacking), but for exponentiation "to the power of" is the clearest reading. Avoid confusing "**" (power) with "*" (multiply): 2 ** 3 is "2 to the power of 3" = 8, not 6.
5 / 5
How is the ternary conditional operator "?:" read aloud (as in cond ? a : b)?
The ?: construct is the ternary (conditional) operator, and developers read it several ways. Often they name it — "use the ternary here" — or read it literally: cond ? a : b as "cond question mark a colon b". Some say "inline if-else". The "?" is the question mark and ":" is the colon. All these readings are common and understood. The key terms to know are "ternary" (the operator's name), "question mark", and "colon".