You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
568 B

5 years ago
## priorprime
### Instructions
You are given an integer.
Your function must return sum of all prime numbers prior to the number exclusively. The number is not included.
### Expected function and structure
5 years ago
```go
package main
5 years ago
func PriorPrime(x int) int {
5 years ago
}
```
### Usage
5 years ago
Here is a possible program to test your function:
```go
package main
import "fmt"
5 years ago
func main() {
fmt.Println(PriorPrime(14))
5 years ago
}
```
Its output:
```console
student@ubuntu:~/priorprime/test$ go build
student@ubuntu:~/priorprime/test$ ./priorprime
5 years ago
41
student@ubuntu:~/priorprime/test$
5 years ago
```