Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Experiment No.

02
Decision Making: Find whether is number is EVEN or ODD.
CODE:
<html>

<head>

<script type="text/javascript"> var x=24;

if(x%2==0){

document.write("<h3>The Given Number is Even Number</h3>");

else{

document.write("<h3>The Given Number is Odd Number</h3>");

</script>

</head>

<body>

</body>

</html>

OUTPUT:
Looping Statements:
CODE:
<html>

<head>

<script type="text/javascript">

document.write("<b>Using do...while loops </b><br />"); var i = 0;

do{

document.write(i + "<br />"); i = i + 1;

}while(i<11)

</script>

</head>

<body>

</body>

</html>

OUTPUT:

You might also like