Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Leap year</title>
- </head>
- <body>
- <script>
- var vuosiluku = prompt("Please enter a year", "2020");
- if (vuosiluku != null) {
- check_leapvuosi(vuosiluku);
- }
- function check_leapvuosi(vuosi){
- if( (0 == vuosi % 4) && (0 != vuosi % 100) || (0 == vuosi % 400) )
- {
- result = vuosi+" is a leap vuosi";
- }
- else
- {
- result = vuosi+" is not a leap vuosi";
- }
- alert(result);
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement