From 5451470cbbb5dc23438f62855e087f32e66e178a Mon Sep 17 00:00:00 2001 From: Orestis <orestis.malaspinas@pm.me> Date: Tue, 28 Sep 2021 22:57:14 +0200 Subject: [PATCH] added exit codes --- examples/tri_selection/tri.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/tri_selection/tri.c b/examples/tri_selection/tri.c index e1feebb..9e5811c 100644 --- a/examples/tri_selection/tri.c +++ b/examples/tri_selection/tri.c @@ -35,4 +35,12 @@ int main() { printf("%f ", tab[i]); } printf("\n"); + + for (int i = 0; i < SIZE - 1; ++i) { + if (tab[i] > tab[i + 1]) { + return EXIT_FAILURE; + } + } + + return EXIT_SUCCESS; } -- GitLab