Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please use this code to anwser the question: #include #define FLUSH stdin = freopen ( NULL , r , stdin ) / /
please use this code to anwser the question:
#include
#define FLUSH stdinfreopenNULLrstdin
Prototype for Recursive function Tn
You must remove this prototype before you submit your assignment
unsigned long Tnint;
This function must collect the n to print Tn number in Tribonacci sequence.
int getn;
In this function, you must create an array of series.
You must fill the array with the Fibonacci numbers.
This function returns the HEAP address of such array
Parameter: n you get from the getn function.
Note: this function must create array of size n
Must detect integer overflow and adjust parameter n to the maximum allowed.
unsigned long tribonacciarrayint;
This function prints Tn Tribonacci number.
Accepts n value you get from getn function.
Note: pointer is used so you can modify value n in case of integer overflow!
Note: inside this function must call tribonacciarray function above!
void printTnint;
Define MINNUMBER and MAXNUMBER symbolic constants that you d use to limit the input of size:
This is starting point. See below how main function should look like in your solution!
int main
int n ;
printfThis program calculated Tribonacci number Tn
;
printfTnTnTnTn where TT and T
;
printfTribonacci Number Td lu
n Tnn;
return ;
Your main function must look like this:
int main
printfThis program calculated Tribonacci number Tn
;
printfTnTnTnTn where TT and T
;
Get value n
int n getn;
Print value Tn
printTn&n;
return ;
You must remove this function before you submit your assignment
Tribonacci numbers start from n:
unsigned long Tnint n
if n return ;
if n return ;
return Tnn Tnn Tnn;
You need to create this function.
See comments for the prototype!
int getn
You need to create this function.
See comments for the prototype!
unsigned long tribonacciarrayint n
Note: size of array should be n So that T array
You need to create this function.
See comments for the prototype!
void printTnint n
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started