I'm trying to follow a C++ programming book, and for one of the example programs it has a Fibonacci sequence (1,1,2,3,5,8,13,etc.).

The object of the program is to identify the ordinal sequence of a number ("8 is the 6th number of the sequence"), and of course you do cin/cout for where the 8 and 6 appear in that sentence.

My question is an aesthetic one: is there a way to have the program notice the last digit of the number? I'm asking because for example because if a number is 122nd in the sequence, it will appear as "122th", which isn't correct? Are there any suggestions?