NEP CMA

PART -A

PROGRAM 1 PROGRAM 2 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 6 PROGRAM 7 PROGRAM 8

PART-B

PROGRAM B1 PROGRAM B2 PROGRAM B3 PROGRAM B4 PROGRAM B5 PROGRAM B6 PROGRAM B7 PROGRAM B8 . . .

 
  
 
 
  
      <!DOCTYPE html>
<html>
<title> </title>
<body>

<h2>LEAP YEAR</h2>
<p> Write a JavaScript program to determine whether a given year is a leap year in the Gregorian
calendar </p>

<p>
  <label>ENTER YEAR:</label>
  <input id="inputyear" type="number" placeholder="xxxx"  >
</p>
<button onclick="checkleapyear(inputyear.value)" > CHECK </button>

<p> Result:<span id="outputnote"></span></p>

<script>
function checkleapyear(valNum) {
  year = parseFloat(valNum);
 
    if ((0 == year % 4) && (0 != year % 100) || (0 == year % 400)) {
        result=' is a leap year'
    } else {
       result=  ' is not a leap year' 
    }
  document.getElementById("outputnote").innerHTML=year + " "+result ;
 
}
</script>

</body>
</html>