java - Figure out Odd Even or Zero by entering the value -
java - Figure out Odd Even or Zero by entering the value -
my teacher asked me question , confused how write out code. understood had do, couldn't write in java. question that: design , implement application determines , prints number of odd , 0 digits. input user/keyboard. don't know how start. can help me here reply , explanation that?(without using string) give thanks much time.
application? it's 3 lines:
int odds = str.replaceall("[^13579]", "").length(); int evens = str.replaceall("[^2468]", "").length(); int zeroes = str.replaceall("[^0]", "").length();
if input not string, create one:
long number; string str = number + "";
java
Comments
Post a Comment