Q.1) What will be the output of the following pseudo code for input 7? 1. Input n 2. Set m = 1, T = 0 3. if (m > n) 4. Go to step 9 5. else 6. T=T+m 7. m = m + 1 8. Go to step 3 9. Print T A. 28 B. 56 C. 32 D. 76 Q.2) What will be the output of the following code? 1. Input a = 3 and b = 4 2. Set result = 1 3. while(b > 0) 4. result = result * a 5. b=b-1 6. End while loop 7. Print result A. 81 B. 64 C. 12 D. 24
Added by Casey C.
Close
Step 1
First, we need to know the question or problem statement to provide an explanation and answer. Show more…
Show all steps
Your feedback will help us improve your experience
Jennifer Hudspeth and 56 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Please answer....and explain too....
Shaiju T.
'explain it correctly please'
Tyna S.
please explain it in detail
Madhur L.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD