Write a function/method/subroutine/... that when given an integer greater than or equal to zero returns a string of the number followed by an apostrophe then the ordinal suffix.



Example

Returns would include 1'st 2'nd 3'rd 11'th 111'th 1001'st 1012'th



Task

Use your routine to show here the output for at least the following (inclusive) ranges of integer inputs:
0..25, 250..265, 1000..1025


Note: apostrophes are now optional to allow correct apostrophe-less English.




 
call printImages    0,   25
call printImages  250,  265
call printImages 1000, 1025
end
 
sub printImages loLim, hiLim
  loLim = int(loLim)
  hiLIm = int(hiLim)
  for i = loLim to hiLim
    print str$(i) + suffix$(i) + " ";
  next i
  print
end sub
 
function suffix$(n)
  n = int(n)
  nMod10 = n mod 10
  nMod100 = n mod 100
  if (nMod10 = 1) and (nMod100 <> 11) then
    suffix$ = "st"
  else
    if (nMod10 = 2) and (nMod100 <> 12) then
      suffix$ = "nd"
    else
      if (NMod10 = 3) and (NMod100 <> 13) then
        suffix$ = "rd"
      else
        suffix$ = "th"
      end if
    end if
  end if
end function
 