Cannot get the same output

#include
using namespace std;
int main()
{
int user_input;
int row=1, col=1;

cout<< "Enter the number: ";
cin>> user_input;
while(row<=user_input)
{
    if(row%2!=0)
    {
        while(col<=row)
        {
            cout<<1;
            col = col + 1;
        }
    }
    else
    {
        cout<<1;
        while(col<=row-2)
        {
            cout<<0;
            col = col + 1;
        }
        cout<<1;
    }
    cout<<endl;
    row = row + 1;
}
return 0;

}

Please provide the code in Coding Blocks IDE.
Also it seems your are printing an unnecessary line “Enter number” this will lead to failure in testcases.
Also you are not setting col =1 for every iteration