samedi 5 décembre 2020

Random even odd number generation in c#

I have a function with two arguments say a and b. So basically, whenever I call this method 50% times it should return a and 50% times it should return b.

public string Randomization(string a, string b)

I thought of doing this using random number generation and if number generated is even, return a and if odd, return b. How could I achieve this or is there any other simple way ?




Aucun commentaire:

Enregistrer un commentaire