aboutsummaryrefslogtreecommitdiff
path: root/Semestr 4/ask/lista8/even.c
diff options
context:
space:
mode:
Diffstat (limited to 'Semestr 4/ask/lista8/even.c')
-rw-r--r--Semestr 4/ask/lista8/even.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Semestr 4/ask/lista8/even.c b/Semestr 4/ask/lista8/even.c
new file mode 100644
index 0000000..5bf8606
--- /dev/null
+++ b/Semestr 4/ask/lista8/even.c
@@ -0,0 +1,8 @@
+int is_odd(long n);
+
+int is_even(long n) {
+ if (n == 0)
+ return 1;
+ else
+ return is_odd(n - 1);
+}