From bec040861b23dbcad99244b1afd60774873d3b2d Mon Sep 17 00:00:00 2001 From: fdai7731 Date: Wed, 7 Feb 2024 23:12:34 +0100 Subject: [PATCH] Declaration for Random Number --- src/main/c/Mathe.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/c/Mathe.c b/src/main/c/Mathe.c index ced2432..683434b 100644 --- a/src/main/c/Mathe.c +++ b/src/main/c/Mathe.c @@ -67,3 +67,8 @@ void zeigeAuswahl(const char* text); //17 void initialisiereZufallsgenerator() { srand(time(NULL)); + + +//18 +int generiereZufallszahl(int min, int max) { + return min + (int)((double)rand() / (RAND_MAX + 1) * (max - min + 1));