Update two parameters in for loop
using System;
class CommaOp1
{
const int StartChar = 33;
const int EndChar = 125;
const int CharactersPerLine = 5;
static public void Main()
{
for (int i = StartChar, j = 1; i <= EndChar; i++, j++)
{
Console.Write("{0}={1} ", i, (char)i);
if (0 == (j % CharactersPerLine))
{
Console.WriteLine("");
}
}
}
}
Related examples in the same category