factorial computation

Factorial Computation


To compute factorial of a given number:

Input: Given the Number to be computed => N.

Output: Factorial of N is Fact.

Step 1: Input Number whose Factorial is to be computed: N.

Step 2: Initialize Fact =1.

Assign N = M.

Step 3: Check if M is greater than 1.

Yes: Assign product of Fact and M to Fact.

Decrement M. Repeat Step 3.

No: Output Factorial of N is Fact.

Step 4: Stop.

Qus. 1 : Which variable must be initialized to 1 in the algorithm for factorial computation?

  1. Counter
  2. Factorial value
  3. Input number
  4. Loop limit

Programs

Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad