Cody

# Problem 44397. Determine whether the input is odd, even, or neither.

Solution 3252293

Submitted on 17 Oct 2020 by Dyuman Joshi
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
x = 1; n_correct = 'odd'; assert(isequal(oddornot(x),n_correct))

ans = 'error' ans = 'odd'

2   Pass
x = 12; n_correct = 'even'; assert(isequal(oddornot(x),n_correct))

ans = 'error' ans = 'even'

3   Pass
x = 467.3; n_correct = 'error'; assert(isequal(oddornot(x),n_correct))

ans = 'error'

4   Pass
x = -911; n_correct = 'odd'; assert(isequal(oddornot(x),n_correct))

ans = 'error' ans = 'odd'

5   Pass
x = 8230749726348; n_correct = 'even'; assert(isequal(oddornot(x),n_correct))

ans = 'error' ans = 'even'

6   Pass
x = pi; n_correct = 'error'; assert(isequal(oddornot(x),n_correct))

ans = 'error'

7   Pass
x = 'a'; n_correct = 'error'; assert(isequal(oddornot(x),n_correct))

ans = 'error'

8   Pass
x = 'donald'; n_correct = 'error'; assert(isequal(oddornot(x),n_correct))

ans = 'error'

### Community Treasure Hunt

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

Start Hunting!