-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFun37.java
More file actions
26 lines (22 loc) · 610 Bytes
/
Fun37.java
File metadata and controls
26 lines (22 loc) · 610 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package fun;
public class Fun37 {
public static void main(String[] args) {
System.out.println(Power1(2.3, 2.3));//A1
System.out.println(Power1(1, 2.3));//A2
System.out.println(Power1(5, 2.3));//A3
// System.out.println(Power2(2.3, 2.3));
}//2.3
public static double Power1(double a, double b) {
double pow = 0;
pow = Math.pow(a, b);
return pow;
}
// public static double Power2(double a, double b) {
// double f = 1;
// for (int i = 1; i <= b; i++) {
// f *= a;
// }
//
// return f;
// }
}