From aa18e1bb9369cef22815f12a6617f53e72262c62 Mon Sep 17 00:00:00 2001 From: Pratiksha Churya A <91747537+PratikshaChuryaA@users.noreply.github.com> Date: Fri, 28 Oct 2022 20:16:42 +0530 Subject: [PATCH] Create Leap year or not --- c_programs/Leap year or not | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 c_programs/Leap year or not diff --git a/c_programs/Leap year or not b/c_programs/Leap year or not new file mode 100644 index 0000000..cf909bb --- /dev/null +++ b/c_programs/Leap year or not @@ -0,0 +1,21 @@ +#include +int main() +{ + int year; + printf("Enter the year to check if it is a leap year: "); + scanf("%d", &year); + + if(year % 4 == 0){ + if(year % 100 == 0){ + if(year % 400 == 0) + printf("%d is a leap year\n", year); + else + printf("%d is not a leap year\n", year); + } + else + printf("%d is a leap year\n", year); + } + else + printf("%d is not a leap year\n", year); + return 0; +}