Files
  • main.cs
  • main.exe
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
using System;

class PowerOf2Calculation {
    public static void Main() {
        int num = 1, count = 0;
        do
        {
            count++;
            num = num * 2;
        } while (num <= 1000000000);
        Console.WriteLine("2^{0} = {1}", count, num);
    }
}