In OCaml Programming Language, write a function:
val prime_separator : int list -> int list * int list = that takes an integer list as an input, and returns a pair of integer lists where the prime numbers are in the first while the composite numbers are in the second returned list.#prime_separator [1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11];;- : int list * int list = ([11; 7; 5; 3; 2], [10; 9; 8; 6; 4; 1])
that takes an integer list as an input, and returns a pair of integer lists where the prime numbers are in the first while the composite numbers are in the second returned list.
#prime_separator [1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11];;
- : int list * int list = ([11; 7; 5; 3; 2], [10; 9; 8; 6; 4; 1])
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here