I'm doing the following program in C #:
Create an abstract class named "Combinatorial Analysis", which is responsible for specifying, in addition to calculating the factorial of a number, the methods due for Calculation of Permutations, Arrays and Combinations of elements.
I need to make a class called Combinatorial Analysis where I have to calculate the factorial of a number to be entered by the user in the main program.
I know how to do the factorial, but inside a class, you are not even free to do any kind of equal accounts in static void Main.
This is the method I've done:
public abstract class AnaliseCombinatoria
{
static int Fatorial(int numero)
{
for(int i = 0; numero <= 1; i--)
{
return numero * (numero - 1);
}
}
}
You are giving an error in the variable "Factorial" saying: "AnalyzeCombinatoria.Fatorial (int)": Not all code paths return a value
How do you do calculations inside a class?