Answer to Question #45616 in Other Engineering for mike
Step 1 Set a =1, b = 1, c = 2, k = 1
Step 2 While k < n
(a)replace c with a+b
(b)replace a with b
(c)replace b with c
(d)replace k with k + 1
Step 3 Print b
Step 2: There are 6(n-1)+ n=7n-6 operations. (n-1) times 6 (3 "=" and 3 "+") and n checkings if k<n).
Step 3: print() is not elementary operation.
Thus we have 3+(7n-6)+0=7n-3 operations.
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!