procedure fact(i) j := 1 while i > 0 do { j *:= i i -:= 1 } return j end