I must write a program which receives 2 integer inputs, x and y, and computes
x to the y power (without using the Math.pow method).
I must write code which perform this computation.
I must say I am desperately needing help.
Printable View
I must write a program which receives 2 integer inputs, x and y, and computes
x to the y power (without using the Math.pow method).
I must write code which perform this computation.
I must say I am desperately needing help.
What part of it do you need help with? What have you done so far?
"Bumi, Windu " <wbumi@rcnchicago.com> wrote in message
news:3bcc78b3$1@news.devx.com...
>
> I must write a program which receives 2 integer inputs, x and y, and
computes
> x to the y power (without using the Math.pow method).
> I must write code which perform this computation.
>
> I must say I am desperately needing help.
>
public class temp{
private static long s(int a,int b){
for(int i=1;i<b;i++)
a*=a;
return a;
}
public static void main(String[] args){
long temp=s(10,2);
System.out.println("s(10,2)="+temp);
}
}