here is the code I am having an issue with:
int printDividers(int x)
{
    for (int j=0; j<x+1; j++)
    {
        if (x%j==0) cout << j << ", ";
    }
}
int main()
{
    int z;
    cout << "Enter a number and the program will print out it's dividors:" << endl;
    cin >> z;
    printDividers(z);
    return 0;
}
After entering your number it says main.exe stopped working. I haven't figured out why, I can't spot the error in the code.