Space for google add

To display maximum number between two numbers.

 


Write JavaScript code to display maximum  number between two numbers .(Using if else statement )

 

Program :- 

<html>

        <body>

<h2><center><font face="alzerian">

            To display maximum number between two numbers.

</h2></center></font>

              <script language="javascript">

  var a,b

                 a=prompt("Enter value of a","a")

                      b=prompt("Enter value of b","b")

                            parseInt(a)>parseInt(b)

 

               document.write("a = " ,a)

document.write("</br>")

              document.write("b = " ,b)

document.write("</br>")

 

if(a>b)

         {

                 document.write("a is maximum")

         }

else

        {

                 document.write("b is maximum")

        }

                </script>

         </body>

</html>

 



Output :- 








Post a Comment

0 Comments