Hi, anyone who can help me how to display the corresponding place value of the entered 3 digit number using .length?
Like if I enter 126, it would appear like,
Thanks in advance.
posted 1 year ago
Welcome to the Ranch
There is a standard way to use the / and % operators to get individual digits from a number. Note that number will probably be an int, and that is a primitive, and primitives don't have fields or methods. You cannot writeOut of that code, the only line that doesn't have a compiler error in is line 1. As I said, try the % and / operators and see what happens.