Programming Concepts

Check your understanding - Assignments

Assignment is the action of putting a value into a variable. It is often represented by the '=' symbol, which is read as 'is assigned the value of'. What would the result of the following assignments? Note: Here, PI is a constant with a value set at 3.1

intRadius = 2
dblArea = intRadius * intRadius * PI

No. Variables on the right of an assignment are unchanged in an assignment.
No. Variables on the right of an assignment are unchanged in an assignment - variable values aren't 'consumed' when they are used.
No. Variables on the right of an assignment are unchanged in an assignment, in addition constants can't change.
← Previous 1 2 3 4 5 6 7 8 9 10 11 12 Next →