Question: 1. For the following program segment, give the output produced by the segment: 1 int i = 13; 2 while (i> 0) { int

  1. For the following program segment, give the output produced by the segment: 1 int i = 13; 2 while (i> 0) { int 

1. For the following program segment, give the output produced by the segment: 1 int i = 13; 2 while (i> 0) { int j = 2; while (j 3. For the following program segment, give the output produced by the segment: String a="potato", b="tophat"; 1 2 String output=""; 3 int pos=0; 4 10 6789 OHN 345 TTTTT 11 12 13 14 15 while (pos =0) { if (a.charAt (pos) == b.charAt (pos2)) { output-output+a.charAt(pos); } } pos2 pos2-1; } pos= pos + 1; System.out.println ("The final output is: "+output);

Step by Step Solution

3.45 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Lets analyze each of th... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!