Home > database >  How to fill an empty space with numbers
How to fill an empty space with numbers

Time:07-20

I need it to be like the example here:

01230
01231
01232
01233

What I have right now

01230
1
2
3

and my code

for (int i = 0; i < 4; i  )
{
    Console.Write(i);
}

    
for (int i = 0; i < 4; i  )
{
    Console.WriteLine(i);
}

CodePudding user response:

for (int i = 0; i < 4; i  )
{
   Console.WriteLine($"0123{i}");
}

CodePudding user response:

for (int i = 0; i < 4; i  )
{
  for (int j = 0; j < 4; j  )
  {
      Console.Write(j);
  }
      Console.WriteLine(i);
      Console.WriteLine();
}
  •  Tags:  
  • c#
  • Related