Question

Ex 3) Trace the following flowchart for when input values are 12, 3, -3, 6, -11, -14, -1, -1, -3, 2, 0 and complete the trace
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Given, Flow Chart

& input values are 12,3,-3,6,-11,-14,-1,-1,-3,2,0

From the flow chart, we can understand that, it counts the number of positive numbers 'p' and negative numbers 'n' with a special condition where p <= 2 * n;

Glance through the below images for more understanding!

=>for first pass of input 12,

num <= 12 ; then as 12 > 0; p is increased by 1 i.e; p = p + 1;

as condition num != 0 is satisfied but p <= 2*n is not satisfied as 1<= 0 is not true.

peudocode maini - Trace Table num Output ut p=0, n o . Put CJ num, will num! - 0)44 (P22*n)) { of (num > 0) { P= P + 1; if (n→ flow chart dynebo s Mentioned in Currenquat Start (on and of the program. Tenunator (on Tuminal & Claws stent (or Begin (on

Add a comment
Know the answer?
Add Answer to:
Ex 3) Trace the following flowchart for when input values are 12, 3, -3, 6, -11,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT