In your programs you will often want to assign values to variables and, later on, test those values.
For example, you might write a program in which you test the age of an employee in order to calculate his or her bonus. Here I use the ‘greater than' operator > to test of the value of the age variable is greater than 45: if (age > 45)
bonus = 1000;
Operators
Operators are special symbols that are used to do specific operations such as making comparisons between two values or adding and multiplying numbers. One of the most important operators is the assignment operator, =, (...) more...