Mega Code Archive

 
Categories / C# / Development Class
 

Math Pow Method returns a specified number raised to the specified power

using System; public class Example {    public static void 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));    } }