Expressions

You will learn

Arithmetic operators and comparisons on the lesson constants, and the bool a comparison gives back.

An expression combines names and numbers with operators. With A = 17 and B = 5, A + B is 22, A - B is 12, A * B is 85, A / B is 3 because whole numbers divide without a fraction, and A % B is 2, the remainder. Comparisons give true or false. One limit of the test runner on this site: it does not read a minus sign in front of a number, so write negative values as constants.

Open the interactive lesson →