20.3k views
2 votes
Define the followimg terms as it relates to coding.

Expression

Variable

Assignment operator​

1 Answer

4 votes

Answer and Explanation:

In coding, an expression is used to represent values. It may contain variables and/or constant.

Examples of expressions are:


a - b
a * 2
4 - 3

Variables are literally memory locations. They are used to storing values, and they assume the values they store during program execution.

At any point in the program, the value of the variable can be changed.

Lastly, there are guidelines that follow naming variables (depending on the programming language).

Examples of accepted variable names (in C++) are:

num, num_1, num1

Assignment operator

This is the = sign. It is used for assigning values to variables.

Examples of how it is used are:


num1 = a - b


num\_1 = a*2


num = 4 - 3

The following is a wrong usage of the operator


4 - 3 = num

User Tom Dalton
by
5.4k points