%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% persistance FUNCTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function persistance (number, pers : int) : int %input the two digit number less than 100 var pproduct : int := number %repeats procedure of multiplying 2 digits for each product var ten : int var pnum : int var one : int := 0 test := number loop exit when test < 10 %stops when value of test is less than ten (equals value of 1st digit) count += 1 %remainder is value of 2nd digit test -= 10 %detemines value of 1st digit by subtracting value of number by ten end loop pproduct := test * count %multiplies 1st and 2nd digit by each other pnum := pers + 1 if pproduct < 10 then result pnum elsif pproduct > 9 then result persistance (pproduct, pnum) end if end persistance %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MAINLINE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% var input : int put "Enter digits of two digit number singularly." % user inputs value for number get input put "The persistance number is ", persistance (input, 0),"."