Question: 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

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 Algorithm

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!