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

Author Question: What is the output of the following fragment? for (int i = 0; i < 15; i++) {if (i % 4 == ... (Read 39 times)

debasdf

  • Hero Member
  • *****
  • Posts: 570

Question 1

What is the output of the following fragment?

int i = 1;
int j = 1;
while (i < 5) {
i++;
j = j * 2;
}
System.out.println(j);

◦ 16
◦ 64
◦ 4
◦ 8
◦ 32

Question 2

What is the output of the following fragment?

for (int i = 0; i < 15; i++) {
if (i % 4 == 1)
System.out.print(i + " ");
}

◦ 1 3 5 7 9 11 13 15
◦ 1 4 8 12
◦ 1 5 9 13 16
◦ 1 5 9 13
◦ 1 3 5 7 9 11 13


Related Topics

Need homework help now?

Ask unlimited questions for free

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

olivia_paige29

  • 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




debasdf

  • Member
  • Posts: 570
Reply 2 on: May 6, 2020
Great answer, keep it coming :)


DylanD1323

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

 

Did you know?

The newest statin drug, rosuvastatin, has been called a superstatin because it appears to reduce LDL cholesterol to a greater degree than the other approved statin drugs.

Did you know?

When taking monoamine oxidase inhibitors, people should avoid a variety of foods, which include alcoholic beverages, bean curd, broad (fava) bean pods, cheese, fish, ginseng, protein extracts, meat, sauerkraut, shrimp paste, soups, and yeast.

Did you know?

Bacteria have been found alive in a lake buried one half mile under ice in Antarctica.

Did you know?

Nearly 31 million adults in America have a total cholesterol level that is more than 240 mg per dL.

Did you know?

The first monoclonal antibodies were made exclusively from mouse cells. Some are now fully human, which means they are likely to be safer and may be more effective than older monoclonal antibodies.

For a complete list of videos, visit our video library