Even Odd in V

Published on 15 December 2024 (Updated: 15 December 2024)

Welcome to the Even Odd in V page! Here, you'll find the source code for this program as well as a description of how the program works.

Current Solution

module main

import os
import strconv

fn main() {
	if os.args.len < 2 {
		println('Usage: please input a number')
		exit(1)
	}

	num := strconv.atoi(os.args[1]) or {
		println('Usage: please input a number')
		exit(1)
	}

	print(match num % 2 {
		0 { 'Even' }
		1, -1 { 'Odd' }
		else { 'Usage: please input a number' }
	})
}

Even Odd in V was written by:

If you see anything you'd like to change or update, please consider contributing.

How to Implement the Solution

No 'How to Implement the Solution' section available. Please consider contributing.

How to Run the Solution

No 'How to Run the Solution' section available. Please consider contributing.