using System; public class Test { public static void Main() { CalculatePower(5, 3); // 125 CalculatePower(8, 4); // 4096 CalculatePower(6, 2); // 36 } private static long CalculatePower(int Number, int PowerOf) { long Result = Number; for (int i = PowerOf; i > 1; i--) { Result = (Result * Number); } Console.WriteLine(Result.ToString()); return Result; } }