Closed. This question is
CodePudding user response:
try this
void Main()
{
Console.WriteLine();
Console.WriteLine("Keifer Bly Unit 1 Project");
Console.WriteLine("Section 1");
Console.WriteLine("**********Section 1 * *********");
Console.WriteLine();
Console.WriteLine("");
Console.Write("The Fibonacci value of 10 is: ");
Console.WriteLine(fibonacci(10));
Console.WriteLine();
Console.WriteLine();
Console.WriteLine("Section 2");
Console.WriteLine("");
Console.WriteLine();
Console.Write("The factorial value of 10 is: ");
Console.WriteLine(factorial(10));
Console.WriteLine();
}
public static int fibonacci(int number)
{
if (number == 1 || number == 2)
{
return 1;
}
return fibonacci(number - 1) fibonacci(number - 2);
}
public static int factorial(int number)
{
if (number == 1 || number == 2) return 1;
return factorial(number - 1) factorial(number - 2);
}
output
Keifer Bly Unit 1 Project
Section 1
**********Section 1 * *********
The Fibonacci value of 10 is: 55
Section 2
The factorial value of 10 is: 55