I just got stuck with the pattern of zeroes , this shows that did you account for negative values

#include
using namespace std;
int main() {
int N ;
cin>>N;
int num ;
cin>>num;
int i , j , k , l , m , n, o ;
for(int i = 1 ; i <= N ; i++)
{
if(num < 0)
{
if(i < N-2) //3
{
for(int j = 1 ; j <= i ; j++)
{
cout << num << “\t” ;

            }
            num++ ;
            cout << "\n" ;
        }
        else
        {
            for(int k = 1 ; k < 2 ; k++)
            {
                cout << num << "\t";
            }
            for(int l = 2 ; l < i ; l++)
            {
                cout << " 0" << "\t";
            }
            for(int m = 1 ; m < 2 ; m++)
            {
                cout << num << "\t" ;
                num++ ;
            }
            cout << "\n" ;
        }
    }
    else
    {
        if(i < N-2) //3
        {
            for(int j = 1 ; j <= i ; j++)
            {
                cout << num << "\t" ;
                
            }
            num++ ;
            cout << "\n" ;
        }
        else
        {
            for(int k = 1 ; k < 2 ; k++)
            {
                cout << num << "\t";
            }
            for(int l = 2 ; l < i ; l++)
            {
                cout << "0" << "\t";
            }
            for(int m = 1 ; m < 2 ; m++)
            {
                cout << num << "\t" ;
                num++ ;
            }
            cout << "\n" ;
        }
    }
}
return 0;

}

hi @deepshreyamishra301_1918130c8477386b
please refer here u can write it in simple way also https://ide.codingblocks.com/s/657479 ive commented it

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.