function [] = Toss2Dice(SumX) k=1; if (SumX > 0) & (SumX < 12) then for i = 1:6 for j = 1:6 x = i + j; if x == SumX then PossOutput(k) = strcat([string(i), string(j)]); k = k + 1; end end end else printf('Number %d is out of range', SumX); end if k>1 then printf('There are %d event that the sum is %d\n',k-1,SumX); printf('All events are:\n'); for i = 1:k-1 printf('%s\n', PossOutput(i)); end end endfunction