I'm having difficulty coming up with the correct code for the following problem.
Let's say I have 100 cupcakes and I have to randomly give it out to random boys and girls. The program will then have to determine which group has the majority.
What would be the easiest approach?
int cake = rand() % 100;
cout << cake << endl;
I'm trying to use this code to generate a random number between 1 and 100 and using if then statements to figure out which group received more. Am I on the right track cause I'm really confused right now. Hope this is easy to understand.
I guess what I don't understand is how am I supposed to divide 100 randomly between two groups (boys and girls).