Search This Blog

Friday 8 August 2014

07. JSP Program to Find the Biggest among Three Numbers using HTML Interface.

    Filename: Big3.html
    <!--07. Biggest among Three numbers-->
    <html>
    <head>
    <title>Find the biggest among three numbers</title>
    </head>
    <body bgcolor="orange">
    <center><h1> Find the biggest among three numbers </h1></center>
    <form action="Big3.jsp" method="post">
    <table>
    <tr><td>Enter the First Number :</td><td><input autofocus type="text" name="t1" ></td></tr>
    <tr><td>Enter the Second Number :</td><td><input type="text" name="t2" ></td></tr>
    <tr><td>Enter the Third Number : </td><td><input type="text" name="t3" ></td></tr>
    <tr><td></td><td><input type="submit" value="Find Big" ></td></tr>
    </table>
    </form>
    </body>
    </html>



     Filename: Big3.jsp
    <!--07. JSP program to find the biggest among three numbers.-->
     <%@ page import="java.lang.*" %>
    <html>
    <body bgcolor="orange">
    <%
        int a= Integer.parseInt(request.getParameter("t1"));
        int b= Integer.parseInt(request.getParameter("t2"));
        int c= Integer.parseInt(request.getParameter("t3"));
    %>
    <h1>Biggest Number is:
    <%
        if ((a>b) && (a>c))
            out.println(a);
        else if (b>c)
            out.println(b);
        else
            out.println(c);
    %>
    </h1>
    </body>
    </html>

No comments :

Post a Comment

FREE Hit Counters