Cody

# Problem 933. Ordinal numbers

Solution 2101250

Submitted on 21 Jan 2020 by Asif Newaz
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
assert(isequal(ord(1),'1st'))

a = '1' b = 1×4 cell array {'st'} {'nd'} {'rd'} {'th'}

2   Pass
assert(isequal(ord(2),'2nd'))

a = '2' b = 1×4 cell array {'st'} {'nd'} {'rd'} {'th'}

3   Pass
assert(isequal(ord(3),'3rd'))

a = '3' b = 1×4 cell array {'st'} {'nd'} {'rd'} {'th'}

4   Pass
assert(isequal(ord(4),'4th'))

a = '4' b = 1×4 cell array {'st'} {'nd'} {'rd'} {'th'}

5   Pass
assert(isequal(ord(5),'5th'))

a = '5' b = 1×4 cell array {'st'} {'nd'} {'rd'} {'th'}

6   Pass
assert(isequal(ord(10),'10th'))

a = '10' b = 1×4 cell array {'st'} {'nd'} {'rd'} {'th'}

7   Pass
assert(isequal(ord(11),'11th'))

a = '11' b = 1×4 cell array {'st'} {'nd'} {'rd'} {'th'}

8   Pass
assert(isequal(ord(12),'12th'))

a = '12' b = 1×4 cell array {'st'} {'nd'} {'rd'} {'th'}

9   Pass
assert(isequal(ord(13),'13th'))

a = '13' b = 1×4 cell array {'st'} {'nd'} {'rd'} {'th'}

10   Pass
assert(isequal(ord(14),'14th'))

a = '14' b = 1×4 cell array {'st'} {'nd'} {'rd'} {'th'}

11   Pass
assert(isequal(ord(15),'15th'))

a = '15' b = 1×4 cell array {'st'} {'nd'} {'rd'} {'th'}

12   Pass
assert(isequal(ord(82),'82nd'))

a = '82' b = 1×4 cell array {'st'} {'nd'} {'rd'} {'th'}

13   Pass
assert(isequal(ord(126),'126th'))

a = '126' b = 1×4 cell array {'st'} {'nd'} {'rd'} {'th'}

14   Pass
assert(isequal(ord(911),'911th'))

a = '911' b = 1×4 cell array {'st'} {'nd'} {'rd'} {'th'}

15   Pass
assert(isequal(ord(2012),'2012th'))

a = '2012' b = 1×4 cell array {'st'} {'nd'} {'rd'} {'th'}

16   Pass
assert(isequal(ord(4077),'4077th'))

a = '4077' b = 1×4 cell array {'st'} {'nd'} {'rd'} {'th'}

17   Pass
assert(isequal(ord(0),'0th'))

a = '0' b = 1×4 cell array {'st'} {'nd'} {'rd'} {'th'}

18   Pass
assert(isequal(ord(-101),'-101st'))

a = '-101' b = 1×4 cell array {'st'} {'nd'} {'rd'} {'th'}

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!