Forum

PLSQL Program Sum o...
 
Share:
Notifications
Clear all

PLSQL Program Sum of number between 1 to 100 using SQL

1 Posts
1 Users
0 Likes
193 Views
jeevan 123
Posts: 18
Topic starter
(@jeevan303500)
Active Member
Joined: 1 year ago

How to get sum of number between 1 to 100

Here you go..

Declare

a number;

sum_of number :=0;

Begin

a:=1;

loop

sum_of:=sum_of+a;

exit when (a=100);

a:=a+1;

end loop;

dbms_output.put_line('Sum between 1 to 100 is '||sum_of);

End;

Leave a reply

Author Name

Author Email

Title *

 
Preview 0 Revisions Saved
Share: