2.Write a program in to compute the factorial of any given number using a do while loop.
Objective
The main fundamental objective of the program is to compute the factorial of an any input number using a do while loop in C programming language. Factorial is the product of all positive integers up to a given number.
Purpose
The purpose of this given program is to determine how a do while loop can be used to compute the factorial of an any number. By using a do while loop we confirm that the loop body is performed at least once before checking the loop condition.
Real Life Applications
In mathematics factorials are usually used in the combinatory sciences the division of mathematics concerned with counting ordering and choosing objects. Factorial numbers play an important role in computing permutations and combinations. Permutations refers to the arrangement of objects in a particular order whereas combinations refer to the selection of objects irrespective of order.
Factorial numbers advantage is to decide the total number of possible choices in a situation.
For example in probability theory factorials are commonly used to calculate the number of ways a set of objects can be arranged. This is mainly appropriate in situations where the direction of things is important such as defining the sequence of events or selecting a committee with specific roles assigned to each members.
In statistics computing factorial of any numbers are surely used in experimental designs and in analysis of variance (ANOVA). Factorial designs comprise fact finding effect of numerous factors
on a response variable by seeing all possible combinations of factor stages.
Factor numbers help to decide the total number of action combinations and factor properties in factorial models.
In computer science factorial of a numbers are used to design and optimize algorithms.
For example factorial numbers are used in recursive algorithms such as calculating the factorial of a number using recursion.
By dividing the problem into smaller sub problems recursive algorithms use factorial numbers to efficiently compute the result.
In addition factorial numbers are used in a variety of programming problems such as constructing permutations of factor sets, applying mathematical functions, and solving integration problems. In the C programming language beginners often use factorial calculus to understand iterations, loops, and basic arithmetic operations.