% hw026.m
% John Burkardt
% The date M/D is the N-th day of the year.  Find N.
%
m = input ( '  Enter a month number between 1 and 12:' );
d = input ( '  Enter a day number for that month:' );

days =  [  31,    28,    31,    30,    31,    30,    31,    31,    30,    31,    30,    31 ];

n = 0;
for i = 1 : m - 1
  n = n + days(i);
end
n = n + d;

fprintf ( '  Date %d/%d is day number %d\n', m, d, n );

