AddThis Social Bookmark Button

Sum of odd number between 1 to 100

Declare
NUM number:=1;
Sum  number:=0;
begin
loop
NUM1 := NUM+2;
Sum:=Sum+Num1;
exit when NUM1=100;
end loop;
dbms_output.put_line (sum);
end;