Leap Year Check
JavaScript
Easy
3 views
Problem Description
Year diya hai. Print YES if leap year else NO. Leap year rules apply (div by 400 or div by 4 but not by 100).
Input Format
One integer year.
Official Solution
const fs=require('fs');const s=fs.readFileSync(0,'utf8').trim();if(!s)process.exit(0);const y=Number(s);const ok=(y%400===0)||((y%4===0)&&(y%100!==0));process.stdout.write(ok?'YES':'NO');
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!