Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Written by: Natalie Sursock; ID:28826728
- % Last modified 22/3/2018
- % Computes whether given year is a leap year.
- %Input arguments
- %----------------
- %inputs: year in YYYY format
- %Output arguments
- %----------------
- %output: leapyeartrue; outputs integer 0 or 1. 0 if year is a leap year and
- %1 if given year isn't a leap year.
- if mod(year,4) == 0
- leap = 1;
- if mod(year,100) == 0
- leap = 0;
- if mod(year,400) == 0
- leap = 1;
- end
- end
- else
- leap = 0;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement