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