100-days-of-rust/Week-01/Day-06_Next-Prime/README.md

21 lines
295 B
Markdown
Raw Permalink Normal View History

2023-03-24 00:52:21 +00:00
## Next Prime
Given an integer, create a function that returns the next prime. If the number is prime, return the number itself.
### Examples
```text
NextPrime(12) ➞ 13
NextPrime(24) ➞ 29
NextPrime(11) ➞ 11
// 11 is a prime, so we return the number itself.
```
---
### Notes
- N/A