Browse Source

function generiereZufallsOperator

remotes/origin/Yasin
fdai7731 11 months ago
parent
commit
1b5dd34772
  1. 7
      src/main/c/Mathe.c

7
src/main/c/Mathe.c

@ -55,7 +55,12 @@ void initialisiereZufallsgenerator() {
int generiereZufallszahl(int min, int max) {
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