A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Better way than this one?
Joined: Oct 27, 2005
Oct 28, 2005 05:13:00
Someone insert a numer like e.g 123
the output is 3 (number of digits)
Is there any easy way to do that instead of this :
System.out.print ( "insert number: ");
int number = Integer.parseInt(br.readLine().trim());
int count = 0;
int digit= number%10;
if(number >= 0) count++;
I know there's a better way to do this , like with a for- loop or something.
I'm getting a "blank" , can't remember
Thanks a lot.
Joined: Aug 05, 2005
Oct 28, 2005 05:21:00
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
subject: Better way than this one?
how to get this output
Update an array
cant get counters to work correctly
a simple counter 1 to 100
Extracting numbers from from a user input and comparing it to
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013