/*This is the seventhth lab of Lab EE107
The purpose of this lab understand how a program that tests to see whether a
year is a leap year
Creating the code and free of syntax and grammatical errors.
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: March 12th, 2024.
    */
#include <stdio.h>



int main() {
    int year_EU;

    // Get user input for the year
    printf("Enter a year: \n");
    scanf("%d", &year_EU);


    // Check if the entered year is a leap year
    if ((year_EU % 4 == 0 && year_EU % 100 != 0) || (year_EU % 400 == 0) ){
 // A year is a leap year if it is evenly divisible by 4 and not by 100, 
     //or if it is evenly divisible by 400
        printf("%d is a leap year.\n", year_EU);
    } else {
        printf("%d is not a leap year.\n", year_EU);
    }

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: