Home Jsp Simple-jsp-example Using Operators in JSP



Using Operators in JSP
Posted on: February 11, 2008 at 12:00 AM
In mathematics, an operator is a function, usually of a special kind depending on the topic.

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.

Related Tags for Using Operators in JSP:
cfunctionsfunctionfuniooperatornameoperaunctonotationsymbolenotulpenotesartcenopartmparesfuncicumeotaprotorsatishanoteduaractrtssthbolatihatctsprodpronolo


More Tutorials from this section

Ask Questions?    Discuss: Using Operators in JSP  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.