Professional Documents
Culture Documents
Control Structures II
(Repetition or Looping)
6.
a. if (nthFibonacci == 1)
The desired Fibonacci number is the first
Fibonacci number. Copy the value of
previous1 into current
b. else if (nthFibonacci == 2)
The desired Fibonacci number is the second
Fibonacci number. Copy the value of
previous2 into current.
• Answer:
*****
****
***
**
*