Ordinal numbers normally add ‘te’ to the end of the spelling of the cardinal numbers less than 20, with a few exceptions:
eins → erste sieben → siebte
drei → dritte acht → achte
Ordinal numbers greater than 19 add ‘ste’ to the end. Ordinals can precede nouns, which is why the definite articles are often used in combination with ordinal numbers. For example:
Er hat die erste Prüfung bestanden.
Keep in mind that the definite article for masculine changes in accusative, as well as the adjective ending: Er hat den zweiten Kaffee bestellt.
The cardinal and ordinal numbers in German are partially listed in the table below.