Outputting ordinal numbers (1st, 2nd, 3rd)
Python 2, 49 bytes

lambda n:`n`+'tsnrhtdd'[n%5*(n%100^15&gt;4&gt;n%10)::4]


An anonymous function. A full program would be counted at 55 bytes. 

'tsnrhtdd'[i::4] encodes the suffixes th st nd rd for values of i from 0 to 3. Given this, all we need is a way to map the values of n to the index of the corresponding suffix, i. A straightforward expression that works is (n%10)*(n%10&lt;4 and 10&lt;n%100&lt;14). We can easily shorten this by dropping the first set of parentheses and observing that n%5 gives the same results as n%10 for the values of n with the special suffixes. With a bit of trial and error, one may also shorten 10&lt;n%100&lt;14 to n%100^15&gt;4, which can be chained with the other conditional to save even more bytes.