Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Project: Advanced_Loops - created by borkins on 2017-04-08.
- */
- import java.util.Scanner;
- public class _03_PowersOfTwo
- {
- public static void main(String[] args)
- {
- Scanner console = new Scanner(System.in);
- int n = Integer.parseInt(console.nextLine());
- for (int i = 0, num = 1; i <= n; i++, num <<= 1) {
- System.out.println(num);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment