This program was suppose to be with a function but I am trying to write without a function first, then adding one later. I am new to programming and still gettin basics. I got this much but its only giving me a 1 and a 0. Ive tried to find the fix, can you guys help me out please?

```
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{
unsigned heads = 0;
unsigned tails = 0;
unsigned flips = 0;
cout<<"enter number of times to flip the coin."<<endl;
cin>>flips;
flips = rand() % 2;
for (int i = 0; i < flips; i ++)
{
if ( flips == 0 )
heads = heads ++;
else
tails ++;
}
cout<< " You flips tails "<<tails<<" times"<<endl;
cout<< " You flips heads "<<heads<<" times"<<endl;
system("pause");
return 0;
}
```