program CountTrailingZeros;
function CountTrailingZeros(n: Integer): Integer;
var
count: Integer;
begin
count := 0;
while (n <> 0) and ((n and 1) = 0) do
begin
Inc(count);
n := n shr 1;
end;
CountTrailingZeros := count;
end;
var
number: Integer;
begin
number := 80; // binary: 1010000
WriteLn('Number of Trailing Zeros: ', CountTrailingZeros(number));
end.
(*
run:
Number of Trailing Zeros: 4
*)