Ethiopian multiplication: Difference between revisions

(→‎{{header|x86 assembly}}: Rename section for caps)
Line 1,153:
 
?></lang>
 
=={{header|PL/I}}==
<lang PL/I>
declare (L(30), R(30)) fixed binary;
declare (i, s) fixed binary;
 
L, R = 0;
put skip list
('hello, please type two values and I will print their product:');
get list (L(1), R(1));
put edit ('The product of ', trim(L(1)), ' and ', trim(R(1)), ' is ') (a);
do i = 1 by 1 while (L(i) ^= 0);
L(i+1) = L(i)/2;
R(i+1) = R(i) * 2;
end;
s = 0;
do i = 1 by 1 while (L(i) > 0);
if iand(L(i), 1) ^= 0 then s = s + R(i);
end;
put edit (trim(s)) (a);
</lang>
 
=={{header|PL/SQL}}==
Anonymous user