PL/SQL Program to Add Two Numbers

PL/SQL Program to Add Two Numbers

Here you will learn that how to create PL/SQL program to add two numbers or integers value and store that in third variable.

PL/SQL Program to Add Two Numbers

Output

The sum of 10 and 20 is: 30

 

Explanation

DECLARE: It is used to declares the variables (num1, num2, and sum).

BEGIN: It Starts the executable part of PL/SQL block.

DBMS_OUTPUT.PUT_LINE: It prints the output/result.

END: It is used to marks the end of the PL/SQL block.

This program is used to add num1 and num2 values, and stores the result in sum variable, then prints the sum.
Note:- If you want you can change the values of num1 and num2 as needed.

 


PL/SQL Program to Add Two Numbers by user input

Output

Enter the first number: 10

Enter the second number: 20

The sum of 10 and 20 is: 30

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top