Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

2 power 8 in java

// 2 power 3 = 8 
//in java here is how its done:
class Main {
  public static void main(String[] args) {

    int base = 2, exponent = 3;

    int result = Math.pow(base, exponent);
    System.out.println("Answer = " + result);
  }
}
/*
result:
Answer = 8
*/
 
PREVIOUS NEXT
Tagged: #power #java
ADD COMMENT
Topic
Name
3+9 =