The following is part of my hobby project. I have a basic c code code which consists of 4 different functions which does addition, subtraction, multiplication and division operations individually. I want these functions to be called in random fashion every time the code is build. For example,
In the first build, let's say i want to do addition first. Then the subtraction, multiplication and division operations should be performed in a random fashion like (subtraction, multiplication, division) or ( multiplication, division, subtraction) or any other set.
And while running the program for the second time, let's say i want to do multiplication first. Then the subtraction, addition and division operations should be performed in a random fashion like (subtraction, addition, division) or ( addition, division, subtraction) or any other set.
In this way, first operation should be the operation related to user input (which might be different every time, the program is build). And at the same time, all other remaining operations should be called and executed in a random fashion.
Can we get this kind of behaviour using C language?
Aucun commentaire:
Enregistrer un commentaire