Website Summary Files Commits Branches @commit @diff @stats
path: root / Week01 / Exercise02 / arrmath.h
diff options
context:
space:
mode:
1 files changed, 15 insertions, 0 deletions
-rw-r--r--Week01/Exercise02/arrmath.h15
diff --git a/Week01/Exercise02/arrmath.h b/Week01/Exercise02/arrmath.h
new file mode 100644
index 0000000..4f1a550
--- /dev/null
+++ b/Week01/Exercise02/arrmath.h
@@ -0,0 +1,15 @@
+#ifndef ARRMATH
+#define ARRMATH
+
+// Сума на стойностите в elements
+int sum(const int* elements, unsigned length);
+// Средно аритметично на стойностите в elements
+double average(const int* elements, unsigned length);
+// Най-голямата стойност в elements
+int largest(const int* elements, unsigned length);
+// Най-малката стойност в elements
+int smallest(const int* elements, unsigned length);
+// Връща индекса на първото срещане на elementToSearch
+unsigned findIndex(const int* elements, unsigned length, int elementToSearch);
+
+#endif