0

I want to print suffix such that st,nd,rd,th after integer....please help

11th Jun 2017, 2:11 AM
Bhuvanesh
Bhuvanesh - avatar
2 Réponses
+ 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"; ... }
11th Jun 2017, 2:17 AM
Jason Runkle
Jason Runkle - avatar