The problem was to write an application that determines and prints the number of odd, even, and zero digits in an integer value read from the keyboard.
i know how to do it but my question is that how do i find out the amount of digits in the number that was inputted by the user in the scanner. for ex:
for (int count=0; count <= XXXXX; count++)
{
if (b==0)
zeroCounter++;
else if (b % 2 == 0)
evenCounter++;
else (b % 2 == 1)
oddCounter++;
b +/ 10;
}
2007-10-22
11:01:18
·
2 answers
·
asked by
Filipinocalypse
3
in
Computers & Internet
➔ Programming & Design