This topic contains a solution. Click here to go to the answer

Author Question: Which of the following loops produces the output?1 2 3 4 1 2 3 1 2 1(I) for (int i = 5; i > 0; i--) ... (Read 45 times)

vicky

  • Hero Member
  • *****
  • Posts: 586
Which of the following loops produces the output?

1 2 3 4 1 2 3 1 2 1

(I)
for (int i = 5; i > 0; i--) {
for (int j = 1; j < i; j++)
System.out.print(j + " ");
System.out.println();
}

(II)
for (int i = 1; i < 5; i++) {
for (int j = 1; j < i; j++)
System.out.print(j + " ");
System.out.println();
}

(III)
int i = 0;
while (i < 5) {
for (int j = 1; j < i; j++)
System.out.print(j + " ");
System.out.println();
i++;
}

(IV)
int i = 5;
while (i > 0) {
for (int j = 1; j < i; j++)
System.out.print(j + " ");
System.out.println();
i--;
}

◦ (I)
◦ (II)
◦ (III)
◦ (IV)


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by vicky on May 6, 2020

coyin

  • Sr. Member
  • ****
  • Posts: 334
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 39% of students answer this correctly




vicky

  • Member
  • Posts: 586
Reply 2 on: May 6, 2020
YES! Correct, THANKS for helping me on my review


JCABRERA33

  • Member
  • Posts: 344
Reply 3 on: Yesterday
Thanks for the timely response, appreciate it

 

Did you know?

Elderly adults are at greatest risk of stroke and myocardial infarction and have the most to gain from prophylaxis. Patients ages 60 to 80 years with blood pressures above 160/90 mm Hg should benefit from antihypertensive treatment.

Did you know?

The most destructive flu epidemic of all times in recorded history occurred in 1918, with approximately 20 million deaths worldwide.

Did you know?

Hypertension is a silent killer because it is deadly and has no significant early symptoms. The danger from hypertension is the extra load on the heart, which can lead to hypertensive heart disease and kidney damage. This occurs without any major symptoms until the high blood pressure becomes extreme. Regular blood pressure checks are an important method of catching hypertension before it can kill you.

Did you know?

The U.S. Pharmacopeia Medication Errors Reporting Program states that approximately 50% of all medication errors involve insulin.

Did you know?

Acetaminophen (Tylenol) in overdose can seriously damage the liver. It should never be taken by people who use alcohol heavily; it can result in severe liver damage and even a condition requiring a liver transplant.

For a complete list of videos, visit our video library