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

Popular posts from this blog

Day 55: Pattern using loops of 100DaysCodingChallenge

Day 7: Square or Power Integer Numbers of 100DaysCodingChallenge

Day 45: Pattern using loops of 100DaysCodingChallenge