Sunday, August 26, 2012

leep year code in javascript


<html>

<body>

<head>

<script type="text/javascript">

function leap(year)

{



if(year % 4==0)



document.write(year+" is a leap year");

else

document.write(year+" is not a leap year");



}

no=prompt("Enter an year to find wheather it is prime of not","2000");

leap(no);

</script>

</head>

</body>

</html>

No comments:

Post a Comment