answersLogoWhite

0

To find the maximum of three numbers using JSP, you can create a simple form to accept three numbers as input. Upon form submission, you can use JSP scriptlets to compare the numbers and determine the maximum. Here’s a basic example:

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <title>Find Maximum of Three Numbers</title>
</head>
<body>
    <form method="post">
        Number 1: <input type="number" name="num1"><br>
        Number 2: <input type="number" name="num2"><br>
        Number 3: <input type="number" name="num3"><br>
        <input type="submit" value="Find Maximum">
    </form>
    <%
        String num1Str = request.getParameter("num1");
        String num2Str = request.getParameter("num2");
        String num3Str = request.getParameter("num3");
        if (num1Str != null && num2Str != null && num3Str != null) {
            int num1 = Integer.parseInt(num1Str);
            int num2 = Integer.parseInt(num2Str);
            int num3 = Integer.parseInt(num3Str);
            int max = Math.max(num1, Math.max(num2, num3));
            out.println("Maximum number is: " + max);
        }
    %>
</body>
</html>

This program displays a form to input three numbers and outputs the maximum number after submission.

User Avatar

AnswerBot

1w ago

What else can I help you with?

Related Questions

How to write a C program to find largest 2 numbers using pointers?

program to find maximum of two numbers using pointers


How do you write an assembly language program to find the sum of n numbers using array?

write an assembly language program to find sum of N numbers


How do you write a VBnet program to find the prime numbers between 100 to 200?

VBnet program to find the prime numbers between 100 to 200?


Write a Shell program to find the smallest number from a set of numbers?

k


Write a Program in lisp to find maximum of three numbers?

(defun max3 (a b c) (cond ((&gt; a b) (cond ((&gt; a c) a) (t c))) ((&gt; b c) b) (t c) ) )


Write a program to find the product of two numbers using Halving and Doubling method?

i need this answer


Write a C program to find the square of two numbers?

Please visit http://talentsealed.blogspot.com/2009/10/to-find-sqaure-of-numbers-using-c.htmlfor the answer.


Write a C program to find the sum of all prime numbers?

Since there is an infinite set of prime numbers the answer would be infinity.


Write a c program to find the maximum of two numbers and print out with its position?

maxValue = function (array) {mxm = array[0];for (i=0; i&lt;array.length; i++) {if (array[i]&gt;mxm) {mxm = array[i];}}return mxm;}; i don't know


Write a flowchart to find the sum of maximum and minimum o N natural numbers without using arrays?

huh?


How do you find the maximum of a set of numbers?

The maximum of a set of numbers is the largest number in the set.


Write a java program to find sum of even and odd numbers in given array?

for(int i = 1; i &lt; 100; i+=2) { System.out.println(i); }