Hi, im kind of stuck on my coding. The problem im stuck on is that it isn't randomly generating "tails", but all "heads." I'm not sure where my problem so can anybody help or give me tips?

Code:
#include <iostream>
using namespace std;
int flip (void);
int main ()

{
	int t=0, h=0;
	for (int i=1; i<=50; i++)
	{
		{
		if (flip==0)
		{
			cout<<"Tails";
			t++;
		}
		else 
		{
			cout<<"Heads";
			h++;
		cout<<" ";
		}
		}
		if (i%5==0)
		cout<<endl;
	}
	cout<<endl;
	cout<<"There are "<<t<<" tails"<<endl;
	cout<<"There are "<<h<<" heads"<<endl;
return 0;
}

int flip (void)
{
	if (rand()% 0)
		return 0;	
	if (rand()% 1)
		return 1;	
}