From be4069db1fff36dacff38ad94aea47e40971dca4 Mon Sep 17 00:00:00 2001 From: fdai7731 Date: Thu, 8 Feb 2024 02:26:24 +0100 Subject: [PATCH] function generiereZufallszahl --- src/main/c/Mathe.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/c/Mathe.c b/src/main/c/Mathe.c index 0c0da1d..9ac095a 100644 --- a/src/main/c/Mathe.c +++ b/src/main/c/Mathe.c @@ -53,6 +53,14 @@ void initialisiereZufallsgenerator() { } +//18 +int generiereZufallszahl(int min, int max) { + return min + (int)((double)rand() / (RAND_MAX + 1) * (max - min + 1)); +} + + + +