Write JavaScript code to display maximum number between two numbers .(Using if else
statement )
<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 :-
0 Comments
If anyone has Doubts or suggestions please let me know