N'th: Difference between revisions

510 bytes added ,  9 years ago
no edit summary
(Undo revision 200164 by KinglerMew (talk) Why remove the modularization?)
No edit summary
Line 440:
250'th 251'st 252'nd 253'rd 254'th 255'th 256'th 257'th 258'th 259'th 260'th 261'st 262'nd 263'rd 264'th 265'th
1000'th 1001'st 1002'nd 1003'rd 1004'th 1005'th 1006'th 1007'th 1008'th 1009'th 1010'th 1011'th 1012'th 1013'th 1014'th 1015'th 1016'th 1017'th 1018'th 1019'th 1020'th 1021'st 1022'nd 1023'rd 1024'th 1025'th</pre>
 
=={{header|ERRE}}==
<lang ERRE>
PROGRAM NTH_SOLVE
 
!
! for rosettacode.org
!
PROCEDURE NTH(S%,E%)
LOCAL I%,SUFF$
FOR I%=S% TO E% DO
SUFF$="th"
IF I% MOD 10=1 AND I% MOD 100<>11 THEN SUFF$="st" END IF
IF I% MOD 10=2 AND I% MOD 100<>12 THEN SUFF$="nd" END IF
IF I% MOD 10=3 AND I% MOD 100<>13 THEN SUFF$="rd" END IF
PRINT(STR$(I%)+SUFF$+" ";)
END FOR
PRINT
END PROCEDURE
 
BEGIN
NTH(0,25)
NTH(250,265)
NTH(1000,1025)
END PROGRAM
</lang>
 
=={{header|Forth}}==
Anonymous user