Ask Question
12 July, 13:23

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

+1
Answers (1)
  1. 12 July, 15:44
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers