English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Is this possible. I need to code for "to the power of" in Java programing. I am very new to this so any helps would be amazing. "To the power of" as in the numerical manipulation, as in the full code?

Thank you

2007-03-01 10:23:14 · 2 answers · asked by Chεεrs [uk] 7 in Computers & Internet Programming & Design

2 answers

import java.lang.Math;

public static void main(String[] args) {
double A; // Base
double B; //Exponent
double answer; //The answer
answer = pow(A, B); //A to teh power of B
System.out.println(answer); //print out answer
}


Use the math package in java. Make sure you include the first line (import java.lang.Math). and then use their pow function.

Now you just need to find a way to let the user input numbers into the A and B variable.

2007-03-01 10:35:12 · answer #1 · answered by Anonymous · 2 0

First Set environment variables For Java.. then try your java instructions click in this link to earnings a thank you to set environment variables java.. after set environment variable you're able to restart your computing device/computing device..

2016-10-17 01:25:07 · answer #2 · answered by archuletta 4 · 0 0

fedest.com, questions and answers