Browse Source

Declaration for Random Operator

remotes/origin/Yasin
fdai7731 11 months ago
parent
commit
7294f511d5
  1. 10
      src/main/c/Mathe.c

10
src/main/c/Mathe.c

@ -72,3 +72,13 @@ void initialisiereZufallsgenerator() {
//18 //18
int generiereZufallszahl(int min, int max) { int generiereZufallszahl(int min, int max) {
return min + (int)((double)rand() / (RAND_MAX + 1) * (max - min + 1)); return min + (int)((double)rand() / (RAND_MAX + 1) * (max - min + 1));
//19
char generiereZufallsOperator() {
char operatoren[] = {'+', '-', '*', '/'};
int index = rand() % 4;
return operatoren[index];
Loading…
Cancel
Save