Hey guys, i'm fairly new here. Just stuck on a program. It seems like it should be right, based on my pseudo code, but something went wrong. Edit: without using Math.pow; Edit: kind of not looking for the answer, just what i did wrong,, other wise, i wont know it for the test.
/**
* @(#)powerRangers.java
*
*
* @*EDITED MY NAME*
* @version 1.00 2010/10/8
*/
import java.util.Scanner;
public class powerRangers
{
/**
* Creates a new instance of <code>powerRangers</code>.
*/
public powerRangers()
{
}
/**
* @param args the command line arguments
*/
public static void main(String[] args)
{
int value, counter = 0, total, icounter;
Scanner scan = new Scanner (System.in);
// ASK FOR VALUE
System.out.println("Enter the value");
value = scan.nextInt();
icounter = (value - 1);
while (icounter <= value)
{
total = (2^icounter);
System.out.println ("2 to the power: " + counter +" is: " + total);
counter ++;
icounter --;
}
}
}