Operators
Programming Use various operators Details Using Operators Consider an example, where you need to develop a C# program for displaying the result and rank of the students in a class. To compute result and ranks, the application needs to perform some calculations and comparisons. You can use various operators in your C# program and use them to compute the results and ranks of the students. Operators like +(addition) and –(subtraction) are used to process variables and return a value. An operator is a set of one or more characters that is used for computations or comparisons. Operators can change one or more data values, called operands, into a new data value. Consider the following expression: X+Y The preceding expression uses two operands, xand y, and an operator, +, to add the values of both the variables. The following figure shows the operator and operands used in the preceding expression. You can use the following types of operators in your C# programs: Arithmetic operators Arithmetic assignment operators Unary operators Comparison operators Logical operators Arithemetic Operators(+ , - , * , / , %) Arithemetic Assignment Operators(= , += , -= , *= , /= , %=) Unary Operators(++ , - -) Comparison Operators(< , > , <= , >= , == , !=) Logical Operators(&& , ! , ||)
Sent from Windows Mail