100 = salesAmount;
?
In terms of assignment operators, why is the above statement illegal?
What will be an ideal response?
This assignment operator has a right-to-left associativity. Associativity is the order in which values are used with operators. An identifier that can appear on the left side of an assignment operator sometimes is referred to as an lvalue, and an item that can appear only on the right side of an assignment operator is an rvalue. A variable can be used as an lvalue or an rvalue, but a literal constant can only be an rvalue.
Since 100 is a numeric constant, it is an rvalue, which is an item that can appear only on the right side of the assignment operator.
You might also like to view...
What is the default program association for JPG files on a Windows computer?
a.Explorer b.Photos c.Picasa d.Preview
Suppose that you are a system administrator of a LINUX/UNIX computer system. What command will you use to remove all print jobs for the user bill on the system?
The following command can be used to accomplish the given task. Assume that the printer name is hp7.