Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Testing {
- public static void main(String args[]) {
- int e;
- int result;
- for(int i = 0; i < 10; i++) {
- result = 1;
- e = i;
- while(e > 0) {
- result *= 2;
- e--;
- }
- System.out.println("2 to the " + i + " power is " + result);
- }
- }
Add Comment
Please, Sign In to add comment