-- program written by Michael B. Feldman -- modified by Elizabeth S. Adams -- to eliminate multiple return statements in function factorial with ada.text_io; with ada.integer_text_io; procedure test_factorial2 is function factorial (n : in positive ) return positive is returnValue : integer; begin if n = 1 then returnValue := 1; else returnValue := n * factorial (n-1); end if; return returnValue; end factorial; begin ada.text_io.put (item => " M N! "); ada.text_io.new_line; ada.text_io.put (item => "-----------------"); ada.text_io.new_line; for num in 1..20 loop ada.integer_text_io.put (item => Num, width => 3); ada.integer_text_io.put (item => factorial (num), width => 11); ada.text_io.new_line; end loop; end test_factorial2;