Math.Pow Method returns a specified number raised to the specified power.
using System;
publicclass Example
{
publicstaticvoid Main()
{
int value = 2;
for (int power = 0; power <= 32; power++)
Console.WriteLine("{0}^{1} = {2:N0} (0x{2:X})",
value, power, (long)Math.Pow(value, power));
}
}