A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
Welcome to the Even Odd in OCaml page! Here, you'll find the source code for this program as well as a description of how the program works.
let even_odd n = if n mod 2 = 0 then "Even" else "Odd"
let parse_args = function [| _; n |] -> int_of_string_opt n | _ -> None
let () =
print_endline
(match parse_args Sys.argv with
| Some num -> even_odd num
| None -> "Usage: please input a number")
Even Odd in OCaml was written by:
If you see anything you'd like to change or update, please consider contributing.
No 'How to Implement the Solution' section available. Please consider contributing.
No 'How to Run the Solution' section available. Please consider contributing.