0
I want to print suffix such that st,nd,rd,th after integer....please help
2 odpowiedzi
+ 1
Like this?
int num = 2;
cout << num << "nd";
You could use a switch case to do it for a number when you don't know what the number will be before hand.
switch(num) {
case 1: cout << num << "st";
...
}