how i fill 10size 1d array randomly 1 and 0 the rest

like `0 0 0 0 0 1 0 0 0 0` or `0 0 0 1 0 0 0 0 0 0` or `0 1 0 0 0 0 0 0 0 0`

```
#include <iostream>
#include<cstdlib>
#include<ctime>
#include<windows.h>

using namespace std;

int main() {
    srand(time(NULL));
    int x[10] = { 0, }, i;
    while (true)
    {
        Sleep(500);
        for (i = 0; i < 10; i++)
        {
            x[i] = rand() % 1 + 1;
            cout << x[i];
        }
        system("cls");
    }
    system("pause");
}

```

I don't want `0 1 0 0 0 1 1 0 1 0` or `0 1 0 1 0 0 1 0 0 1`