
Programming Logic and Design, Introductory 7th Edition by Joyce Farrell
Edition 7ISBN: 1285225562
Programming Logic and Design, Introductory 7th Edition by Joyce Farrell
Edition 7ISBN: 1285225562What is output by each of the pseudocode segments in Figure 5-25?
.
Step 1 of 7
a.
Consider the pseudocode segment given in the question.
The output produced by the pseudocode segment is as follows:
Explanation:
• The variable “a” is initialized to 1, “b” is initialized to 2 and “c” is initialized to 3.
• The while loop runs till the value of “a” is less than the value of “c”.
o The value of “a” is incremented by 1.
o The value of “b” is incremented by c i.e. every time “b” is incremented by 5.
• After the while loop, the pseudocode segment displays the value of “a” as 5, “b” as 25 and “c” as 5.
Step 2 of 7
Step 3 of 7
Step 4 of 7
Step 5 of 7
Step 6 of 7
Step 7 of 7
Why don’t you like this exercise?
Other