Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is as Assembly Language problem. Basically write fibonacci in Assembly language Construct a CUSP program that reads an integer from the keyboard and computes
This is as Assembly Language problem. Basically write fibonacci in Assembly language
Construct a CUSP program that reads an integer from the keyboard and computes the Fibonacci number (FIBON) of the given input, N. The result should be printed on the screen. You should assume that the user enters valid integers only (greater than zero). The Fibonacci function is described in more detail in Chapter 10, with the basic algorithm given in Figure 3.16 VAR N, FN,FNM1,FNM2,I: INTEGER; BEGIN {get value of N) IF (N 1) OR (N 2) THEN BEGIN FIBON- 1: END ELSE BEGIN ( N greater than 2 ) FNMi :- 1; ( Initialize FIB(2)) FNM2: 1; ( Initialize FIB(1) REPEAT ( set up for next iteration ) FNM2FNM1; UNTIL I > N; END[IF}; END[FIBON); Figure 3.16 Iterative Fibonacci AlgorithmStep 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