Module: Arithmetic expressions


Problem

1/7

assignment operator

Theory Click to read/hide

Assignment operator 
We already know that you can set the value of a variable using the input statement. The input statement is used in cases where the value is set by the user during program execution.
But very often we need to set a new value for a variable by calculating it using a certain formula. In this case, operator assignment.
 
The general form of an assignment operator is as follows <variable name> := <expression>;

The assignment operator works like this:
1. first, the expression to the right of the assignment sign is evaluated;
2. The resulting value of the expression is stored (they say "assigned") in the variable to the left of the assignment sign. In this case, the old value of the variable is erased.

For example, if we need to set the value of the c variable to twice the value of the b variable, then we will need to write it like this: c := 2 * b;
Do not forget that in programming you cannot omit multiplication signs in an expression. Otherwise, the computer will not understand what you want to multiply.
For example, you can't just write c := 2b, that would be wrong!

Problem

On the 5th line, write an assignment operator, as a result of which the variable с will take the value of the sum of the variables a and b.