-
Notifications
You must be signed in to change notification settings - Fork 194
Kata: OddEven
Sean Killeen edited this page May 16, 2014
·
1 revision
- Write a program that prints numbers within specified range lets say 1 to 100.
- If number is odd print 'Odd' instead of the number.
- If number is even print 'Even' instead of number.
- Else print number [hint - if number is Prime].
- Prints numbers from 1 to 100
- Print "Even" instead of number, if the number is even, (i.e. divisible by 2)
- Print "Odd" instead of number, if the number is odd, (i.e. not divisible by 2 but not divisible by itself too)
- Print number, if it does not meet above two conditions, (i.e. if number is Prime)
- Make method to accept any number of range [currently we have 1 to 100]
- Create a new method to check Odd/Even/Prime of a single supplied method