anizko

03. Even Powers of 2

Apr 17th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Even_Powers_of_2
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.             int a = 1;
  11.    
  12.             for(int i=0;i<=n;i+=2)
  13.             {
  14.                
  15.              Console.WriteLine(a);
  16.              a *= 4;
  17.                    
  18.                
  19.             }
  20.  
  21.  
  22.            
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment