Coin toss C++

Hello, I am stuck on an assignment once again.. Really all I am confused about is..
I need to make a program the flips a coin a said number of times and it tells how many heads and tails there were while flipping the said amount of times.

Anyways, the part I am stuck on is how do I assign something like heads = 1 and tails = 2 for when the loop runs it will assign a 1 and add it to heads if the toss = 1.

I realize this probably seems confusing from how I wrote the question.

Thanks for any help!
-Torm04
in each iteration get 0 or 1, by rand()%2; if 0 head++; else tail++;
This helped out a lot thank you so much.

-Torm04
Topic archived. No new replies allowed.