#27 – Expressions, Operators and Operands

Expressions are sequences of operators and operands.  Evaluating an expression results in a single value for the entire expression.

Operators are the symbols used in expressions, indicating what operations apply to the operands in the expression.

Operands are the values acted upon by the operators, e.g. literals, results of function calls, other expressions.

There are three kinds of operators:

  • Unary – Takes one operand.  E.g.  x++
  • Binary – Takes two operands.  E.g.  x+y
  • Ternary – Takes three operands (the conditional operator).  E.g.  e ? x : y

More

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

2 Responses to #27 – Expressions, Operators and Operands

  1. Pingback: Tweets that mention #27 – Expressions, Operators and Operands « 2,000 Things You Should Know About C# -- Topsy.com

  2. Pingback: #1,071 – The Unary Minus Operator | 2,000 Things You Should Know About C#

Leave a comment