PL/SQL Calculate the Area of a Circle
PL/SQL Calculate the Area of a Circle Here you will learn pl/sql program to calculate the area of a circle in pl/sql programming. PL/SQL Calculate the Area of a […]
PL/SQL Calculate the Area of a Circle Here you will learn pl/sql program to calculate the area of a circle in pl/sql programming. PL/SQL Calculate the Area of a […]
How to run PL/SQL Program using Notepad To run a PL/SQL program using notepad, you have to write your code in notepad and then execute the program by using SQL*Plus
PL/SQL Program to find factorial of a number using function Here you will get pl/sql program to find factorial of a number using function. PL/SQL Program to find factorial
PL/SQL Program to find factorial of a number using function Read More »
PL/SQL Program to Print Patterns Here you will know PL/SQL program to print patterns of star, numbers and alphabets by using for and while loops. Pattern 1
1 2 3 4 5 6 7 8 9 10 11 12 13 | DECLARE rows NUMBER := 6; -- to print number of rows i NUMBER; j NUMBER; BEGIN FOR i IN 1..rows LOOP FOR j IN 1..i LOOP DBMS_OUTPUT.PUT('*'); -- Print asterisk END LOOP; DBMS_OUTPUT.PUT_LINE(''); -- Move to the next line END LOOP; END; / |
PL/SQL Program to add two numbers using function Here you will learn that how to create PL/SQL program to add two numbers using function. PL/SQL Program to add two
PL/SQL Program to add two numbers using function Read More »
PL/SQL Program to Find largest of 3 numbers Here you will learn pl/sql program to find largest of 3 numbers by using 3 different methods in pl/sql programming. Method
PL/SQL Program to print prime numbers from 1 to 100 Here you will learn pl/sql program to print prime numbers from 1 to 100 using mod and SQRT function in
PL/SQL Program to print prime numbers from 1 to 100 Read More »
PL/SQL Program for Prime Number or Not Here you will learn pl/sql program for prime number or not using mod function in pl/sql programming. PL/SQL Program for Prime Number
PL/SQL Program for Armstrong Number Here you will learn pl/sql program for armstrong number using power function in pl/sql programming. 153 is an Armstrong number because: 13 + 53 +
PL/SQL Program for Palindrome Number Here you will learn pl/sql program for palindrome number using substr function in pl/sql programming. PL/SQL Program for Palindrome Number
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | DECLARE input_number NUMBER := &Enter_Number; -- User will input the number rev_number NUMBER := 0; -- variable to store reverse number temp NUMBER; -- variable to store temp number rem NUMBER; -- variable to store remainder number BEGIN temp := input_number; -- reverse the digits of number WHILE temp > 0 LOOP remainder := MOD(temp, 10); -- Get the last digit rev_number := (rev_number * 10) + rem; -- Build the reversed number temp_number := FLOOR(temp_number / 10); -- Remove the last digit from the number END LOOP; -- Print input and reversed numbers DBMS_OUTPUT.PUT_LINE('Input Number: ' || input_number); DBMS_OUTPUT.PUT_LINE('Reversed Number: ' || rev_number); -- Check if input number is equal to the reversed number IF input_number = rev_number THEN DBMS_OUTPUT.PUT_LINE('The number is a palindrome.'); ELSE DBMS_OUTPUT.PUT_LINE('The number is not a palindrome.'); END IF; END; / |
Output Enter_Number 1259