subject

Consider the following code segment:

String word = "Cafeteria";
for(/* missing condition */)
{
System. out. print(word. substring(i+1,i+2) + " ");
}

The code segment is intended to print every other letter in the word, starting with index 0, to produce the result C f t r a. Which of the following can be used to replace /* missing condition */ so that the code segment works as intended?

int i = 0; i < word. length(); i+=2

int i = -1; i < word. length(); i+=2

int i = 0; i < word. length(); i++

int i = -1; i <= word. length(); i+=2

int i = word. length() - 1; i < -1 ; i-=2

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 23:50, Crull5999
List a few alternative options and input and output over the standerd keyboard and monitor. explain their functioning in details.
Answers: 2
image
Computers and Technology, 23.06.2019 03:30, bellsbella34
Ihave a singular monitor that is a tv for my computer. recently, i took apart my computer and put it back together. when i put in the hdmi cord and booted the computer to see if it worked, the computer turned on fine but the screen was blue with "hdmi no signal." i've tried everything that doesn't require buying spare parts, any answer is appreciated!
Answers: 1
image
Computers and Technology, 24.06.2019 03:00, SiegeHatake4534
Will do anything for brainlest so can you guys me out i will try my best to you out
Answers: 1
image
Computers and Technology, 24.06.2019 15:00, dummynate
Universal windows platform is designed for which windows 10 version?
Answers: 1
You know the right answer?
Consider the following code segment:

String word = "Cafeteria";
for(/* missing con...

Questions in other subjects: