Question

What will be printed for the code below: age = 15 if (age < 13) { print (child) } else if (age >= 13 & age <=19) { print (
1 0
Add a comment Improve this question Transcribed image text
Answer #1

1. Answer: Teenager

Rationale: The code written above commands the software to print "Child" if age is less than 13 or to print "Teenager" if age is between 13 & 19 or to print "Adult" if all other ages. The first line states that age is 15, therefore the software prints "Teenager"

2. Answer: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20

Rationale: The code commands the software that for i lying between 1 and 100, if i is less than or equal to 20, print i. Therefore, the software prints all the numbers less than or equal to 20.

Add a comment
Know the answer?
Add Answer to:
What will be printed for the code below: age = 15 if (age < 13) {...
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