hi folks
how do i find the digits of a number and what value that digit is ?????
to start of may be i just want to print the digits of a number
any help would be greatly appreciated thank you
Prem
int x = 73491;
String s = new String("" + x);
for(int n=0; n<s.length(); n++)
System.out.println("Digit[" + n + "] = " + s.charAt(n));
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.