set serveroutput on;
Declare
a number(4);
n number(4);
s number:=0;
Begin
n:=&n;
a:=1;
loop
s:=s+a;
exit when(a=n);
a:=a+1;
end loop;
dbms_output.put_line('Sum of n numbers = '||s);
end;
/
Declare
a number(4);
n number(4);
s number:=0;
Begin
n:=&n;
a:=1;
loop
s:=s+a;
exit when(a=n);
a:=a+1;
end loop;
dbms_output.put_line('Sum of n numbers = '||s);
end;
/
No comments:
Post a Comment