Find Factorial of a Number in PHP using For Loop & Recursion

How to calculate factorial of a number in PHP. In this tutorial, I am going to discuss factorial program in PHP using recursion as well as iterative approach.

Before solving this problem let’s understand what is factorial?

What is Factorial?

Factorial of a non-negative integer n (n!), is the product of all positive integers less than or equal to n.

For example –

5! = 5 * 4 * 3 * 2 * 1 = 120

4! = 4 * 3 * 2 * 1 = 24

MCQ on Stack and Queue – Data Structure Practice Questions

MCQ on stack and queue data structure. Both Stack and Queue data structure is very important in computer science. In this tutorial, you are going to learn about stack and queue data structure. Also you’ll find MCQ on stack and queues.

In my previous post, i have discussed how to implement stack and queue data structure.

Stack program in C using Array.

Queue data structure and their implementation.

The purpose of this objective questions is to test how well you understand the concept of stack and queue.