Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _04._Even_powers_of_2
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- //четни степени от 0 до n
- //начало: 0
- //край: n
- //повтаряме: печатаме 2 на степен
- //промяна: + 1
- for (int step = 0; step <= n; step++)
- {
- if (step % 2 == 0)
- {
- Console.WriteLine(Math.Pow(2, step));
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement