Digit count
Pascal Loops
how many digits
Flowchart (ISO 5807)
Source code
function digits(n: integer): integer;
var c: integer;
begin
c := 0;
if n = 0 then
c := 1;
while n <> 0 do
begin
c := c + 1;
n := n div 10;
end;
digits := c;
end;