G
george r smith
How can you format the following so that all the numbers line up (right
justification) ?
thanks
static void Main(string[] args)
{
for (int sq = 0; sq < 226; sq+=16)
{
int i = 0;
i = sq & 136;
Console.WriteLine(sq + " " + Convert.ToString(sq,2) + " " +
Convert.ToString(sq,16) + " Test = " + i + " " +
Convert.ToString(136,2));
}
}
current printout:
0 0 0 Test = 0 10001000
16 10000 10 Test = 0 10001000
32 100000 20 Test = 0 10001000
48 110000 30 Test = 0 10001000
64 1000000 40 Test = 0 10001000
....
would like
0 00000000 0 Test = 0 10001000
16 00010000 10 Test = 0 10001000
32 00100000 20 Test = 0 10001000
48 00110000 30 Test = 0 10001000
64 01000000 40 Test = 0 10001000
224 11100000 e0 Test = 128 10001000
justification) ?
thanks
static void Main(string[] args)
{
for (int sq = 0; sq < 226; sq+=16)
{
int i = 0;
i = sq & 136;
Console.WriteLine(sq + " " + Convert.ToString(sq,2) + " " +
Convert.ToString(sq,16) + " Test = " + i + " " +
Convert.ToString(136,2));
}
}
current printout:
0 0 0 Test = 0 10001000
16 10000 10 Test = 0 10001000
32 100000 20 Test = 0 10001000
48 110000 30 Test = 0 10001000
64 1000000 40 Test = 0 10001000
....
would like
0 00000000 0 Test = 0 10001000
16 00010000 10 Test = 0 10001000
32 00100000 20 Test = 0 10001000
48 00110000 30 Test = 0 10001000
64 01000000 40 Test = 0 10001000
224 11100000 e0 Test = 128 10001000