summaryrefslogtreecommitdiff
path: root/exercises/02_functions/functions5.rs
diff options
context:
space:
mode:
Diffstat (limited to 'exercises/02_functions/functions5.rs')
-rw-r--r--exercises/02_functions/functions5.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/exercises/02_functions/functions5.rs b/exercises/02_functions/functions5.rs
new file mode 100644
index 0000000..f1b63f4
--- /dev/null
+++ b/exercises/02_functions/functions5.rs
@@ -0,0 +1,15 @@
+// functions5.rs
+//
+// Execute `rustlings hint functions5` or use the `hint` watch subcommand for a
+// hint.
+
+// I AM NOT DONE
+
+fn main() {
+ let answer = square(3);
+ println!("The square of 3 is {}", answer);
+}
+
+fn square(num: i32) -> i32 {
+ num * num;
+}