Respuesta :
Answer:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int num = scan.nextInt();
int fac = 1;
while(fac <= 9){
System.out.println(num*fac);
fac++;
}
}
}
Explanation:
Hello, I tried out your program, and I just wanted to point out some little issues :)
You need to import the java.util.Scanner in order to use Scanners :)
Also, (not sure if you just didn't copy the stuff at the start) but you need the public class and the public static void main.
Last of all, since you're printing out all of the first 9 multiples, the 9th is included, so you use <= instead of <.
I have sent you the right code above ^^ :)
Please mark brainliest if this has helped you.
Debugging a code involves locating and fixing the errors/bugs in the code.
The error in the code is that, the following print statement is repeated twice
System.out.println(num*fac);
The correction is to remove the first appearance of
System.out.println(num*fac);
So, the corrected code is as follows
Scanner scan = new Scanner(System.in);
int num = scan.nextInt();
int fac = 1;
while(fac < 9){
System.out.println(num*fac);
fac++;
}
Read more about debugging at:
https://brainly.com/question/23527739