the following exercise is from a book im learning from...

Write two programs that each a table of the binary, octal, and hexadecimal equivalents of the decimal numbers in the range of 1-256

a) for the first program, print the results to the console without using any string formats.

b) for the second program, print the results to the console using both the deciamal and hexadecimal string formats (there are no formats for binary and octal in C#).

i have completed the octal conversion for the first program ...

Code:
using System;


class Test
{
	
	
	static void Main(string[] args)
	{
		int octal = 1;
 
		Console.WriteLine("Decimal\t\tOctal");

		for(int dec=1; dec<=256; dec++, octal++)
		{
			Console.Write(dec + "\t\t");//decimal
			
			if(dec%8==0)
				octal += 2;

			switch(dec)
			{
				case 64: octal = 100;
					 break;
				
				case 128: octal = 200;
					 break;

				case 192: octal = 300;
					 break;

				case 256: octal = 400;
					 break;
			
			}//end switch

			Console.Write(octal);
			Console.WriteLine();
			
		}//end loop

		Console.WriteLine("Voila!");
	}
	
}
this works, i guess the code could be more efficient, with regards to the binary and hex conversions i was hoping to get some help with the algorithm or at least point me in the right direction please

luigi