The error is "cannot find symbol variable b" I'd like to understand as well how to correctly write the syntax of the do while loop Thanks.
import java.util.*;
public class pract3ex10 {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
do {
System.out.println("Enter a positive");
int n = s.nextInt();
int x = n;
int m = 0;
if (x < 0) {
System.out.println("Thank You!");
} else {
while (x > 0) {
x = x / 10;
m++;
}
System.out.println("Number of digits in " + n + "= " + m);
}
} while (n > 0);
}
}