blob: 1fc99308c0de8197ebb38048b75e9f78a8e3cc93 [file] [log] [blame] [raw]
use std::env;
const fn square(num: i32) -> i32 {
num * num
}
pub fn main() {
let args: Vec<String> = env::args().collect();
if args.len() > 1 {
let r: i32 = args[1].parse::<i32>().unwrap();
let sq = square(r);
println!("{}", sq);
} else {
println!("Supply a number to square")
}
}