Using Operators



Programming Programs are required to perform a lot more than just simple input and output operations. All computer languages provide tools for some predefined operations. These tools are known as operators. Details The operators are categorized in the following ways: Arithmetic operators: Are used for computation purposes. The symbols that represent arithmetic operations are called arithmetic operators. These include * , / , + , - , and %. Arithmetic operators, as the name suggests, are used to perform arithmetic calculations. An arithmetic expression is easy to calculate if there are few operands. However, if the number of operands increases, it is very difficult to evaluate properly. Therefore, large expressions are evaluated depending on the precedence of the operators being used. The operator having the highest precedence is evaluated first, followed by the rest in the descending order of their precedence. The precedence of the operators can be changed by using parenthesis, which is denoted as ( ). Relational operators: Are used for comparisons and are used for decision-making. Some of the relational operators include ==,<,and>. Relational operators are used to compare two variables or constants. There are six relational operators. Logical operators: Are used for decision-making. Some of the logical operators include AND,OR,andNOT. Logical operators are used to combine expressions containing relational operators.

Sent from Windows Mail

Popular posts from this blog

ch11 review silberschatz operating systems concepts essentials 2nd ed