Slip 29 - A) Write a JavaScript function that accept three numbers and display the larger number

Solution:

<html>
<head>
<script language="JavaScript">
var a,b,c;
a=parseInt(prompt("Enter the value of a:"));
b=parseInt(prompt("Enter the value of b:"));
C=parseInt(prompt("Enter the value of c:"));
if((a>b)&&(a>c))
document.write("Max Value="+ a +"<br>");
else if((b>a)&&(b>c))
document.write("Max Value="+ b +"<br>");
else
document.write("Max Value="+ C +"<br>");
</script>
</head>
<body>
</body>
</html>

Post a Comment

0 Comments