Posted by AnithaKamatchi on Friday, December 27, 2019 | No comments
Program:
declare
n number:=&n;
i number;
begin
i:=n*(n+1);
n:i/2;
dbms_output.put_line('The sum of series is:'||n);
end;
Output:
Enter value for n; 5
The sum of series is: 15
declare
n number:=&n;
i number;
begin
i:=n*(n+1);
n:i/2;
dbms_output.put_line('The sum of series is:'||n);
end;
Output:
Enter value for n; 5
The sum of series is: 15

0 comments:
Post a Comment