Home Jsp Simple-jsp-example Midpoint of two number



Midpoint of two number
Posted on: March 11, 2008 at 12:00 AM
While solving any mathematical problem it becomes important to find the number that is exactly between two numbers.

Midpoint of two number

        

While solving any mathematical problem it becomes important to find the number that is exactly between two numbers.

In this example we are finding a midpoint of two numbers by using the while loop. 

 

The code of the program is given below:

 

 

 

<HTML>
  <HEAD>
    <TITLE>Midpoint of two number </TITLE>
  </HEAD>
  <BODY>
  
  <table align= "left" border="1" bgcolor="#FFFFCC">
  <H1>Midpoint of two number </H1>
    <tr>
	<td>
    <%
      short a,b;
	  a=250;
	  b=500;
	  while(++a < --b);
	  out.println("Midpoint is "+a);	
    %>
	</td>
	</tr>
	</table>
  </BODY>
</HTML>

Output of the Program:

 

Download this example.

 

        

Related Tags for Midpoint of two number:
coopmathcomantimportfindproblemloopnumbersviportnumberusingintthisidoomathematicapoiexamplewhiletopointicalexammidpbetweeneilitimincalmnttweencaesemmathematicalmeproctlxaxampssoeeetwatanyishamplaractrtvinxacttwssthatihatfinicaicapleplprmimidpointndomolo


More Tutorials from this section

Ask Questions?    Discuss: Midpoint of two number  

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.