Why are my if statements not working consistently?

I'm making a coin toss program for my c++ class and we are required to make a function that flips a coin and prints out if it is heads or tails, and print 10 per line. When I ran the program though the if statements I used to detect if the coin was heads or tails weren't enough to pick from the two.

#include #include using namespace std; void coinToss(int times); int main() < srand(time(0)); int times; cout > times; coinToss(times); return 0; > void coinToss(int times) < int toss = 0, count = 0; for(int i = 0; i < times;i++) < toss = rand()%2; if(toss == 1)//Detects if coin is heads. < cout if(toss == 0)//Detects if coin is tails. < cout else //I had to include this for the program to run, further explanation below the code. < cout count++; //Counts to ten if(count == 10) //Skips to the next line if the coin has been tossed ten times. < cout > > 

At one point I replaced the heads or tails with "cout