Question

The following for loop prints numbers in the from ________ through ________. for(int i = 0;...

The following for loop prints numbers in the from ________ through ________. for(int i = 0; i < 22; i++) { System.out.println( i ); }

0 0
Add a comment Improve this question Transcribed image text
Answer #1

[Ans] The loop prints numbers from 0 to 21 .

The code

for(int i=0;i<22;i++){ System.out.println(i); }

This code prints from 0 to 21 each number on each line as the output given below. And the program terminates when i==22 as 22 is not less than 22.

Output of the Code:

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

Thank you! Hit like if you like my work.

Add a comment
Know the answer?
Add Answer to:
The following for loop prints numbers in the from ________ through ________. for(int i = 0;...
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