Answer:
class Main {
static void printPowers(int howMany, int nrRows) {
for(int n=1; n<=nrRows; n++) {
for(int power = 1; power<=howMany; power++) {
System.out.printf("%d ", (int) Math.pow(n, power));
}
System.out.println();
}
}
public static void main(String[] args) {
printPowers(3, 5);
}
}
class Main {
static void printPowers(int howMany, int nrRows) {
int n = 1;
do {
int power = 1;
do {
System.out.printf("%d ", (int) Math.pow(n, power));
power++;
} while (power <= howMany);
System.out.println();
n++;
} while (n <= nrRows);
}
public static void main(String[] args) {
printPowers(3, 5);
}
}
Explanation:
The for loop gives the cleanest, shortest code.
Answer:
logic error occurs when the result is wrong...
syntax error occurs when you use the wrong punctuation...
runtime error occurs when the program starts running...
Answer:
When you ask a question, people have to option to responds and when you have two different users respond on your question, there is the option to give one of them the Brainliest award for the best answer.
Hope this Helps!