Respuesta :

Fibonacci functions in assembly language, both iterative and recursive. In short datatype, the values are kept.

both solution methods

#include<iostream>

using namespace std;  /* Fibonacci: recursive version */ int Fibonacci_R(int n) {         if(n<=0) return 0;         else if(n==1) return 1;         else return Fibonacci_R(n-1)+Fibonacci_R(n-2);   }  // iterative version int Fibonacci_I(int n) {         int fib[] = {0,1,1};         for(int i=2; i<=n; i++)         {                 fib[i%3] = fib[(i-1)%3] + fib[(i-2)%3];                 cout << "fib(" << i << ") = " << fib[i%3] << endl;         }         return fib[n%3]; }  int main(void) {   int a;cout << "a = ";         cin>>a;        

// calculate the fib(i) from scratch for each i <= a using your recursive function         cout << endl << "From recursive function" << endl;         for(int i=1; i<=a; ++i)                 cout << "fib(" << i << ") = " << Fibonacci_R(i) << endl;         cout << endl;          // or calculate fib(a) once and output the intermediate results from the looping version         cout << "From iterative function" << endl;         Fibonacci_I(a);          cout << endl;         return 0; }

complexity O(2^n)

A data type, often known as a type, is a collection of potential values and permitted actions in computer science and computer programming. The data type informs the compiler or interpreter of the programmer's intended use. Integer numbers (of various sizes), floating-point numbers (which resemble real numbers), characters, and Booleans are the fundamental data types that are supported by the majority of computer languages. An expression, such as a variable or function, is limited in what values it can have by its data type. The meaning of the data, the operations that may be performed on it, and the methods for storing items of that type are all defined by the data type.

Learn more about datatype here:

https://brainly.com/question/14213941

#SPJ4