using System.Collections.Generic;
using System.Text;
public class List
{
public static IEnumerable
{
int counter = 0;
int result = 1;
while (counter++ < exponent)
{
result = result * number;
yield return result;
}
}
static void Main()
{
System.Console.WriteLine("Start ....\n");
foreach (int i in Power(2, 8))
Console.Write("{0} ", i);
System.Console.WriteLine("End ....\n");
}
}
No comments:
Post a Comment