Pseudocode Compiler
Practice

Leap Year Checker

HARDSelection

Read a year. Output Leap Year if it is a leap year, or Not a Leap Year otherwise.

Rules:

  • Divisible by 400 → Leap Year
  • Divisible by 100 (but not 400) → Not a Leap Year
  • Divisible by 4 (but not 100) → Leap Year
  • Otherwise → Not a Leap Year

Input: A positive integer year. Output: Leap Year or Not a Leap Year.

Example:

Input:  2024
Output: Leap Year
Premium is coming soon. All grading features are currently unlocked.

Sample Test Cases

Test 1: Divisible by 400
Inputs: 2000
Expected: Leap Year
Test 2: Div by 100, not 400
Inputs: 1900
Expected: Not a Leap Year
Test 3: Divisible by 4
Inputs: 2024
Expected: Leap Year
Test 4: Not divisible by 4
Inputs: 2023
Expected: Not a Leap Year
Press Ctrl+Enter to run your code
or Ctrl+Shift+Enter to grade