Created
July 1, 2022 19:05
-
-
Save nidhi-canopas/0d1f89f765e86afa40efe9e329f77cc3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func IsLeapYear(year int) bool { | |
| return year%4 == 0 && year%100 != 0 || year%400 == 0 | |
| } | |
| /* check for leap year */ | |
| fmt.Println("2020 is leap year: ", IsLeapYear(2020)) | |
| //output: | |
| 2020 is leap year: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment