I want to output the power table from n (0) to n (10) with just the base being inputted using the scanner.
For now, I am having difficulties in setting it up
Code:
else if (option == 2){
int base = keyboard.nextInt();
for (int x = base; x <= base; x++){
System.out.print(base+"^");
for (int y = 0; y <= 10; y++){ // "y" is exponent
System.out.print(y+"=");
}
System.out.println("");
}
}
Sample input:
2
5
Expected Output:
5^0=
5^1=
5^2=
5^3=
- - - several lines are skipped here - - -
5^10=
Note: This is not the expected output, but I want to try out the code by myself this is just the step that would take me to the end result