Table of Contents
Expression
An expression is a combination of variables, operators, values and calls to functions. Expressions need to be evaluated.
Need for Expression:
Suppose if you wish to calculate area. Area depends on various parameters in different situations. E.g. Circle, Rectangle and so on…
In order to find area of circle, the expression π * r * r must be evaluated and for the rectangle the expression is w * l in case of rectangle. Hence, in this case a variable / value / operator are not enough to handle such situation. So expressions are used. Expression is the combination of variables, values and operations.
A simple example of an expression is 10 + 15. An expression can be broken down into operators and operands. Few valid examples are given below.
Invalid Expression
Always values should be assigned in the right hand side of the variable, but in the below example, the value is given in the left hand side of the variable, which is an invalid syntax for expression.
Add Your Heading Text Here
You May Like to Browers More


