The symbol N! represents the product of the first N positive integers. Thus 5! = 5 * 4 *3 * 2 * 1. This is called 5 factorial. The general equation is:
N! = N * (N - 1) * (N - 2) * ... * 1
When a result is defined in terms of itself, it is called a recursive definition. Construct a program that will accept a positive integer from a NumericUpDown control and then compute its factorial when a Button control is clicked. The recursive definition used in the program is as follows:
If N = 1, then N! = 1, otherwise N! = N * (N - 1)!
Anyone have any ideas?
N! = N * (N - 1) * (N - 2) * ... * 1
When a result is defined in terms of itself, it is called a recursive definition. Construct a program that will accept a positive integer from a NumericUpDown control and then compute its factorial when a Button control is clicked. The recursive definition used in the program is as follows:
If N = 1, then N! = 1, otherwise N! = N * (N - 1)!
Anyone have any ideas?