Assignment operator is used to assign a value of an expression to a variable. Usual assignment operator we see is ' = '. e.g.,
a = 5; .
var = expression; The type of var must be compatible with the type of expression . i.e. if the var is of type int , then expression should also be of type int .
Multiple variables can be assigned a same value by chaining the assignment as shown below.
int x, y, z; int a = 100, b = 230, c = 240;
|