-
help with java assignment
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.
-
Re: help with java assignment
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.
>
-
Re: help with java assignment
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);
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|