Day 19: Leap Year of 100DaysCodingChallenge
Hello all,
I have started the 100 days of coding challenge to improve my programming skills..
Today is the Day19 of 100DaysCodingChallenge for
Leap Year taken input by the user.
Code :
let y = prompt("Enter the Year : "); let a = parseInt(y); if ((a % 4 == 0) || (a % 400 == 0) && (a % 100 != 0) ) { console.log(y, "Year is a Leap Year."); } else { console.log(y, "Year is not a Leap Year."); }
Output :
Happy Coding:)
Comments
Post a Comment