using System; //include the namespace
namespace program
{
class ab
{
static void Main(String[] args)
{
int i,j,c=0;
for(i=0;i<4;i++) //loop for row
{
for(j=0;j<=i;j++) //loop for column
{
c++; //increment in count variable
if(c%2==0)
Console.Write(0);
else
Console.Write(1);
}
Console.WriteLine(); //for new line
}
}
}
}
Consider the program:
Output