Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Exercise: is prime?

Implement a function that receives a number and returns true if it is a prime number.

Implement another function that, given a number, will return different enum variants if the number was prime number, composite number, zero or one.