From b8e4349369b246fc77e7666b79245462afb2fe46 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 3936007..873b96b 100644 --- a/src/main/c/Mathe.c +++ b/src/main/c/Mathe.c @@ -51,6 +51,14 @@ void initialisiereZufallsgenerator() { } +//18 +int generiereZufallszahl(int min, int max) { + return min + (int)((double)rand() / (RAND_MAX + 1) * (max - min + 1)); +} + + + +