Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.27 KB | None | 0 0
  1. class Power {
  2.     public static void main(String args[]) {
  3.     int e;
  4.     int result;
  5.  
  6.     for(int i=0; i<10; i++) {
  7.         result = 1;
  8.         e = i;
  9.         while(e>0) {
  10.             result *=2;
  11.             e--;
  12.         }
  13.  
  14.         System.out.println("2 в степени " +i+ " равно " +result);
  15.  
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement