Using Operators in JSP

In mathematics, an operator is a function, usually of a special kind depending on the topic.

Using Operators in JSP

Using Operators in JSP

        

In mathematics, an operator is a function, usually of a special kind depending on the topic. An operator is a function that acts on functions to produce other functions. A operator symbol or operator name is a notation that denotes a particular operator. 

There are many types of operators.

 

  1. postfix operator      var++, var--
  2. unary     ++var, --var, +var, -var,  ! , ¬
  3. multiplicative    *, /, %
  4. additive       +, -
  5. shift       <<, >>, >>>
  6. relational      < >, <=, >=, instanceof
  7. equality         = =, !=
  8. bitwise AND     &
  9. logical AND        &&
  10. logical OR       | |
  11. bitwise exclusive OR      ^
  12. bitwise inclusive OR        |
  13.  ternary      ?, :
  14. assignment       =, +=, -=, /=, *=, %=, ^=, |=, <<=, >>=, >>>=

 

The code of the program is given below:

<HTML>
  <HEAD>
    <TITLE>Using Operators in Jsp</TITLE>
  </HEAD>
  <BODY>
  <table border="1" align="center">
  <tr><td>
    <H1>Using Operators in Jsp</H1>
    <%
        int Operator1 = 23, operartor2 = 40, SumOper;
       SumOper = Operator1 + operartor2 ;
        out.println(Operator1 + " + " +  operartor2 +
            " = " + SumOper);
     %></tr></td>
	 <BR><BR> <tr><td>
	 <%
        int Operator3 = 3, operartor4 = 4, MulOper;
       MulOper = Operator1 * operartor2 ;
        out.println(Operator1 + " * " +  operartor2 +
            " = " + MulOper);
     %></tr></td>
</table>
  </BODY>
</HTML>

 

Output of the Program:

 

Download this example.