Aim:
             To execute the arithmetic operation using SQL queries.

Algorithm:

Step 1: Start the program.

Step 2: Declare the variables.

Step 3: Execute the arithmetic operation.

Step 4: Get the output.

Step 5: Stop the process.

Program:


DECLARE

    var1 integer;
    var2 integer;
    var3 integer;
    var4 integer;
    var5 integer;
    var6 integer;

BEGIN

    var1:=:var1;
    var2:=:var2;
    var3:=var1+var2;
    dbms_output.put_line(' Addition of  Two Numbers:'||var3);
    var4:=var1-var2;
    dbms_output.put_line(' Subtraction of  Two Numbers:'||var4);
    var5:=var1*var2;
    dbms_output.put_line(' Multiplication of Two Numbers:'||var5);
    var6:=var1/var2;
    dbms_output.put_line(' Division of  Two Number:'||var6);
END;

OUTPUT:

VAR1
VAR2
Addition  of  Two  Numbers: 25
Subtraction  of  Two  Numbers: 15
Multiplication  of  Two  Numbers: 100
Division  of  Two  Number: 4

Post a Comment

أحدث أقدم