public static void Main()
{
int i, j;
Console.Write(" ");
for (i = 1; i < 10; i++)
Console.Write(String.Format("{0,3:d}", i));
Console.WriteLine();
for (i = 0; i < 32; i++)
Console.Write("=");
Console.WriteLine();
for (i = 1; i < 10; i++)
{
Console.Write(i + " | ");
for (j = 1; j < 10; j++)
Console.Write(String.Format("{0,3:d}", i * j));
Console.WriteLine();
}
Console.ReadKey();
}
Some person did show me this piece of code and told that
Any programmer, systems engineer, or systems mathematician who has seriously studied C# should know the answer.
I don't see anything too wrong with it.
It has table limits hardcoded (10), but the table itself is for 9 numbers only, so this is not a crime.
Doing
i + " | "
is not very nice for performance and memory usage, but this is such trivia.
The person does not respond to me what's was wrong with this code, I can't sleep now thinking about it!