Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.IO;
- using System.Net;
- using System.Linq;
- namespace ConsoleApp1
- {
- public class Program { public static void Main() {
- foreach (double d in Pow(2, 16))
- {
- Console.WriteLine("Power: " + d);
- }
- }
- public static IEnumerable<double> Pow(double baseNumber, int exponentNumber)
- {
- double currentPower;
- for (double i = 0; i < exponentNumber; i++)
- {
- currentPower = Math.Pow(baseNumber, exponentNumber);
- yield return currentPower;
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment