Factorial Computation Assignment Help

Assignment Help: >> Algorithms for Problem Solving >> Factorial Computation

Factorial Computation

 Factorial: The product of all positive integers from 1 to n is called the 'factorial n'. It is denoted by n!.

Example:

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

    = 720

n! = n* (n-1)* (n-2) * (n-3) * ..............3*2*1

Where n is a positive integer number.

Note:

0! = 1                     4! = 24

1! = 1                     5! = 120

2! = 2                     6! = 720

3! = 6                    7! = 4940

Algorithm:

Step 1: Start

Step 2: Take the number from the keyboard of which the factorial is to be calculated.

Step 3: Assign the value of i=1 and fact=1

Step 4: Calculate fact=fact*i.

Step 5: Increment the value of i by one.

Step 6: Repeat step 4, step 5 till step 4 has been executed with the value of i=n.

Step 7: Print the value of fact. (Here fact is a variable)

Step 7: Stop.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd