Pure Programmer
Blue Matrix


Cluster Map

Project: Leap Year Determination

Write a program to determine if a given calendar year is a [[leap year]]. Leap years are generally those that are evenly divided by 4. There is an exception, however, for years that are evenly divisible by 100 but not by 400. Test with the values 2016 (a leap year), 2015 (not a leap year), 2000 (a leap year), 1900 (not a leap year). You should write a function isLeapYear() that takes a year argument and returns true or false.

Output
$ swiftc LeapYear2.swift -I . -L . -lUtils error: link command failed with exit code 1 (use -v to see invocation) ld: library not found for -lUtils clang: error: linker command failed with exit code 1 (use -v to see invocation)

Solution