menu
Qammunity
Login
Register
My account
Edit my Profile
Private messages
My favorites
Ask a Question
Questions
Unanswered
Tags
Categories
Ask a Question
What is the output of the code snippet given below? string s = "aeiou"; int i = 0; do { system.out.print(s.substring(i, i + 1)); i++; if (i >= 3) { i = 5; } } while (i < 5);?
asked
Sep 26, 2018
121k
views
4
votes
What is the output of the code snippet given below? string s = "aeiou"; int i = 0; do { system.out.print(s.substring(i, i + 1)); i++; if (i >= 3) { i = 5; } } while (i < 5);?
Computers and Technology
high-school
Itaymendel
asked
by
Itaymendel
7.9k
points
answer
comment
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
0
votes
This prints
aei
The loop progresses for i equal to 0, 1 and 2. But then i gets increased to 3, it gets set to 5, effectively terminating the loop. So only 3 characters get printed.
Adriano Di Giovanni
answered
Oct 2, 2018
by
Adriano Di Giovanni
7.8k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
← Prev Question
Next Question →
Related questions
asked
May 27, 2024
113k
views
For vowel in 'aeiou': print("I'd like to buy a", vowel)
Elva
asked
May 27, 2024
by
Elva
7.3k
points
English
high-school
1
answer
3
votes
113k
views
asked
Dec 18, 2024
9.9k
views
Write a menu driven program which will allow the user to enter a string and then select an analysis option (opt): opt 1 character count in string (lower and upper case letters) opt 2 vowel count (aeiou
Sbarzowski
asked
Dec 18, 2024
by
Sbarzowski
7.3k
points
Engineering
high-school
1
answer
4
votes
9.9k
views
asked
Jun 27, 2024
207k
views
If the five vowels aeiou have the value of first five prime numbers respectively what is the aggregate of such numbers
Tobym
asked
Jun 27, 2024
by
Tobym
8.6k
points
Advanced Placement (AP)
college
1
answer
4
votes
207k
views
Ask a Question
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.
9.4m
questions
12.2m
answers
Other Questions
“What does it mean when we “rework” copyrighted material?”
The book shows how to add and subtract binary and decimal numbers. However, other numbering systems are also very popular when dealing with computers. The octal (base 8) numbering system is one of these.
Seven basic internal components found in a computer tower
Please help me ! All you do is just put it it all in your own words ! Please this is for my reported card!i don't know how to put it in my own words because my English is not that good!
describe an advance in technology that makes life more enjoyable. what discoveries contribute to this technology?
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search Qammunity