Draw a flowchart and write an algorithm to calculate the factorial of a given number.

 Hello Students, In this blog, I am about to share the solution of IGNOU MCS011 June 2022 Previous year question paper.

This is the first question of the question paper and the question is given below: 

Draw a flowchart and write an algorithm to calculate the factorial of a given number.

 Before going to the main answer, let us understand what is factorial of a number.

What is factorial of a number ?

Factorial is a product of all positive integer less than or equal to a giver number n. Factorial is denoted by a symbol (!). In simple language, factorial is multiplying the whole number until 1.

For Example,

Factorial of 5! = 5x4x3x2x1 = 120 

let us move to the algorithm and Flowchart.

Algorithm of factorial of a number.

Step 1 : Start

Step 2 : Read the input number from the user.

Step 3 :  Declare & Initialize Variable i = 1, fact =1

Step 4 : Repeat the loop until i<=num

                fact = fact * i

                i = i++

Step 5 : Calculate : Print fact tp get the factorial of a given number

Step 6 : Stop

 Flowchart of factorial of a number


I hope you guys like this solution, if you like it then please follow and share it with your fellow students.


Easy Engineering Concepts

Author & Editor

Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.

0 $type={blogger}:

Post a Comment