Search:

Type: Posts; User: javapenguin

Search: Search took 0.12 seconds.

  1. Replies
    5
    Views
    3,277

    Re: Program to compute powers

    public power(int num, int power)
    {
    int num2;
    if (power == 0 && num!=0)
    {
    num2 = 1;
    }
    else if (power == 1)
    {
    num2 = num;
  2. Replies
    5
    Views
    3,277

    Re: Program to compute powers

    You know there already is a class called Math that has a method called power that takes two numbers and raises the first number to the power of the second number.
Results 1 to 2 of 2