Cody

Problem 933. Ordinal numbers

Given an integer n, return the corresponding ordinal number as a character string. For example,

   ord(1)='1st'
   ord(2)='2nd'
   ord(3)='3rd'
   ord(4)='4th'

This is the dictionary definition of ordinal number, as opposed to the mathematical definition.

Solution Stats

37.76% Correct | 62.24% Incorrect
Last solution submitted on May 31, 2016
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more