Multiple choice technology programming languages

What is an assignment statement ?

  1. Adding a number to an int

  2. Assigning a multiplication

  3. Assigning a name to a variable

  4. Assigning a value to a variable

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

An assignment statement assigns a value to a variable using the equals operator (=). For example, int x = 5 assigns the value 5 to variable x. The right side is evaluated first, then the result is stored in the variable on the left. This is fundamental to programming.