
You need to implement a C#
The program should have a function named Fibonacci(int n) that takes an integer as an argument and returns an integer representing the nth Fibonacci number.
Constraints:
The input integer will be within the range of 0 <= n <= 45
The function should have a time complexity of O(2^n)
You can test the program using the following test cases:
Console.WriteLine(Fibonacci(0)); // 0
Console.WriteLine(Fibonacci(1)); // 1
Console.WriteLine(Fibonacci(2)); // 1
Console.WriteLine(Fibonacci(3)); // 2
Console.WriteLine(Fibonacci(4)); // 3

Step by stepSolved in 3 steps with 1 images

- pl z in pythonarrow_forwardIn C++, write a program that reads in an array of type int. You may assume that there are fewer than 20 entries in the array. The output must be a two-column list. The first column is a list of the distinct array elements and the second column is the count of the number of occurences of each element.arrow_forwardpython only define the following function: This function must reset the value of every task in a checklist to False. It accept just one parameter: the checklist object to reset, and it must return the (now modified) checklist object that it was given. Define resetChecklist with 1 parameter Use def to define resetChecklist with 1 parameter Use a return statement Within the definition of resetChecklist with 1 parameter, use return _in at least one place. Use any kind of loop Within the definition of resetChecklist with 1 parameter, use any kind of loop in at least one place.arrow_forward
- c programming Task 3: Complete armstrong_task3.c by implementing armstrong_recursive function. int armstrong_recursive (int arm); It performs same operation as in Task 1, however in a recursive manner. A number to be checked whether it is armstrong or not is given as an input and the function returns the summation of the digits. If the returned value is equal to the given input value then it is an armstrong number.arrow_forwardPlease answer the following in Python programming language Assuming that my_tuple is a correctly created tuple, the fact that tuples are immutable means that the following function : my_tuple[1]=my_tuple[1]+my_tuple[0] Is illegal May be illegal if the tuple contains strings Can be executed if and only if the tuple contains at least 2 elements Is fully correctarrow_forwardWrit a program with c++ language to do the following tasks : The user can input one original image and target scales . According to the user’s requirement, this image can resized to the target scale. The program can show the original image and the resized image. *The core function should be Bilinear_interpolation(original image, target height, target width) The output of this function is the resized image and then the user can save it. *You can use image processing libraries to assist your codes, such as Opencv. The functions included in the libraries which are off‐the‐shelf can be used to read images, operate images and save images.arrow_forward
- Create a function using Java: Number of Rows = 3-6 Number of Columns = 3-6 Function Name: winInDiagonalBSParameters: board: 2D integer array, piece: integerReturn: booleanAssume board is valid 2D int array, piece is X==1/O==2.Look at all backward slash \ diagonal in the board. If any backward slash \ diagonal has atleast 3 consecutive entries with a given type of piece (X/O) (3 in a row XXX, OOO), then return true,otherwise false.arrow_forwardYou are required to write a program that creates a mini database of HairColor objects..... For this, create a structure HairColor with fields brand – string color - string price - float totalVolume – float currentVolume – float // amount of volume currently available. You need to provide following functions in the struct Provide a function print() so that when called, this function prints the details about the Hair color in formatted manner. IsAvailable(String Technique) which checks the volume of color in the bottle if available for the required technique then returns true otherwise false. isEmpty() this will check whether the bottle is empty or not. You need to provide the function apply (String technique). This function represents the action of applying hair color to hair based on technique user selects Techniques are (highlight, Bronde, Ombre, Sombre) also note down please check that the color is available because volume required for each type of technique is different as for…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





