There are a couple of things that you're going to need to do.
First thing is to use the code brackets when you post code, its the [<>] button on the right side when you're posting.
Please put a space between case and the test value.
case 1: count1++;
The
break
s should be between each case and the next, and is not needed at the very end (and usually there is a
default:
just in case an unexpected number is fed into your switch).
Your if statements also have a problem, &&count3 does not mean what you think it does.
1 2 3 4 5
|
if(count1 > count2) // a good boolean-check
if(count1 > count2 && count1 > count3) // Probably what you wanted, two boolean checks in a single if statement
if(count1 > count2 && count3) // Bad: actually means; if count1 is greater than count2 and count3 doesn't equal 0
|
In your second if statement, you want to change your cout to output count2 instead of count3.
Finally when you get this worked out, you're going to want to look up srand(time), which will seed your random number generator.
Good attempt, especially if you're studying on your own out of a book, but please consider posting in the beginner's forum, people are more likely to give you step by step help in that forum (including me, I was a bit terse here, I'm less rude over there.)
(Really, I'm sorry about being rude about your code, I can see you're a first time poster here, don't worry, I'm just up later than I should be, I promise this community is more inviting than what I've let on...)
[Edit]
I got my own karma for posting so late, you actually had the correct understanding of modulus, I've removed reference to that in my instructions.