Answer:
8)
Scanner scanner = new Scanner(System.in);
System.out.print("Enter a number: ");
int num = scanner.nextInt();
for (int i = 0; i < num; i++) {
System.out.print("* ");
}
9)
for (int i = 1; i <= 10; i++) {
System.out.print(i * i + " ");
}
10)
for (int i = 1; i < 9; i++) {
if (i % 3 == 0) {
System.out.println("?");
} else {
System.out.println(i);
}
}
11)
Scanner scanner = new Scanner(System.in);
System.out.println("Enter a number: ");
int n = scanner.nextInt();
int factorial = 1;
for (int i = 1; i <= n; i++) {
factorial = factorial * i;
}
System.out.println(factorial);