LeapDays - % caluculate the n of leap days if (y...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
%Count the number of leap year days between Jan 1, 1900, and % Dec 31 of the inputted year in the 21st century, inclusive. % noLD = 0; %number of leap days from 1/1/1900 x = 0; %number of leap days from y to 12/31/2199 y = input('Enter a year from 1900 to 2199, inclusive: ');
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % caluculate the n of leap days if (y < 2100) noLD = ceil((y - 1900) / 4); else noLD = floor((y - 1900) / 4) - 1; end fprintf('# of leap year days from 1/1/1900 to 12/31/%d = %d\n', y, noLD);...
View Full Document

This note was uploaded on 03/15/2011 for the course COM S 100 at Cornell University (Engineering School).

Ask a homework question - tutors are online