Advertisement
dragonbs

Even Powers of 2

Oct 4th, 2022
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _04.EvenPowersof2
  4. {
  5.     internal class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int number = int.Parse(Console.ReadLine());
  10.             int num = 1;
  11.             for (int value = 0; value <= number; value+=2)
  12.             {
  13.                 Console.WriteLine(num);
  14.                 num = num * 2 * 2;
  15.             }
  16.         }
  17.     }
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement