xxxxxxxxxx
#include<stdio.h>
int main(){
for(int i =0; i<=5; i++)//loop responsible for writing columns
{
for(int j = 0; j<=i; j++)//loop responsible for writing rows
{
printf("%d ", j);
}
printf("\n");
}
}
//output
/*
0
0 1
0 1 2
0 1 2 3
0 1 2 3 4
0 1 2 3 4 5
*/