Addition of Two Numbers
declare
a number;
b number;
c number;
begin
a:= &a;
b:= &b;
c:= a+b;
dbms_output.put_line('Sum of '|| a ||' and ' || b ||' is ' || c);
10* end;
SQL> /
Enter value for a: 20
old a:= &a;
new a:= 20;
Enter value for b: 30
old b:= &b;
new b:= 30;
Sum of 20 and 30 is 50
declare
a number;
b number;
c number;
begin
a:= &a;
b:= &b;
c:= a+b;
dbms_output.put_line('Sum of '|| a ||' and ' || b ||' is ' || c);
10* end;
SQL> /
Enter value for a: 20
old a:= &a;
new a:= 20;
Enter value for b: 30
old b:= &b;
new b:= 30;
Sum of 20 and 30 is 50
No comments:
Post a Comment