DEV Community

Ivan Ivanov
Ivan Ivanov

Posted on

4. Even Powers of 2 (Second Solution)

using System;
using System.Diagnostics.Tracing;

namespace EvenPowersOf_2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            for (int power = 0; power <= n; power += 2)
            {
                Console.WriteLine(Math.Pow(2, power));
            }


        }
    }
}

Enter fullscreen mode Exit fullscreen mode

Top comments (0)