Ask Question
29 February, 02:58

Consider the following pseudocode. What does it produce? Set a = 0 Set b = 0 Set c = 1 Set d = 1 Report the value of d Repeat until a equals 10 Set d = b + c Set b = c Set c = d Add 1 to a Report the value of d

+2
Answers (1)
  1. 29 February, 03:09
    0
    The answer for the given question is : 1 1 2 3 5 8 13 21 34 55 89

    Explanation:

    Initially the variable has been initialized a=0, b=0, c=1, d=1 respectively then next statement will be executed and it will print the value of d i. e 1. After that next statement is executed check the loop condition which is true so it executed the next statement i. e d = b + c so d=0+1 so d=1 after that it changes the value b = c and c = d so b=1 and c=1 and increment the value of a i. e a=a+1 a=1 and printing the value of d. The loop will iterate untill the condition of a is true and same process will follow.

    Output : 1 1 2 3 5 8 13 21 34 55 89
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Consider the following pseudocode. What does it produce? Set a = 0 Set b = 0 Set c = 1 Set d = 1 Report the value of d Repeat until a ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers