
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Find the factorial of a number in pl/sql using C++.
In this section, we will see how to find factorial of a number using the PL/SQL. In PL/SQL code, some group of commands is arranged within a block of the related declaration of statements.
Factorial of a number is basically multiplication of all integers from 1 to n, where n is the given number. So n! = n * (n – 1) * (n – 2) * … * 2 * 1.
Example (PL/SQL)
DECLARE fact number :=1; n number := &1; BEGIN while n > 0 loop fact:=n*fact; n:=n-1; end loop; dbms_output.put_line(fact); END;
Output
Consider 5 has given 120
- Related Questions & Answers
- Reverse a Number in PL/SQL
- How to Reverse a String in PL/SQL using C++
- Sum of the first and last digit of a number in PL/SQL
- C++ Program to Find Factorial of a Number using Iteration
- C++ Program to Find Factorial of a Number using Recursion
- How to Find the Factorial of a Number using Python?
- Find the area and perimeter of right triangle in PL/SQL
- C++ Program to Find Factorial of a Number using Dynamic Programming
- Difference between SQL and PL/SQL
- What is PL/SQL?
- Count odd and even digits in a number in PL/SQL
- Block of PL/SQL in Oracle DBMS
- Print pyramid of tutorialspoint in PL/SQL
- Explain the PL/SQL Engine in DBMS
- Difference Between T-SQL and PL-SQL
Advertisements