Assignment

Why Trust Techopedia

What Does Assignment Mean?

An assignment is a statement in computer programming that is used to set a value to a variable name. The operator used to do assignment is denoted with an equal sign (=). This operand works by assigning the value on the right-hand side of the operand to the operand on the left-hand side.

Advertisements

It is possible for the same variable to hold different values at different instants of time.

Techopedia Explains Assignment

A simple assignment statement could be:

int x = 5

This means that x can only take integer values, and currently a value of 5 is assigned to the variable x.

A single variable can hold various values at different times based on its life span and scope. When a variable which is already assigned a value is assigned another value, the new assignment value overwrites the previously assigned
value. The assignment statement also varies from programming language to programming language.

Advertisements

Related Terms

Margaret Rouse
Technology expert
Margaret Rouse
Technology expert

Margaret is an award-winning writer and educator known for her ability to explain complex technical topics to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles in the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret’s idea of ​​a fun day is to help IT and business professionals to learn to speak each other’s highly specialized languages.