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 40 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
Thanks for the timely response, appreciate it


sultana.d

  • Member
  • Posts: 320
Reply 3 on: Yesterday
Excellent

 

Did you know?

There are more sensory neurons in the tongue than in any other part of the body.

Did you know?

Throughout history, plants containing cardiac steroids have been used as heart drugs and as poisons (e.g., in arrows used in combat), emetics, and diuretics.

Did you know?

Historic treatments for rheumatoid arthritis have included gold salts, acupuncture, a diet consisting of apples or rhubarb, nutmeg, nettles, bee venom, bracelets made of copper, prayer, rest, tooth extractions, fasting, honey, vitamins, insulin, snow collected on Christmas, magnets, and electric convulsion therapy.

Did you know?

In 2012, nearly 24 milliion Americans, aged 12 and older, had abused an illicit drug, according to the National Institute on Drug Abuse (NIDA).

Did you know?

The modern decimal position system was the invention of the Hindus (around 800 AD), involving the placing of numerals to indicate their value (units, tens, hundreds, and so on).

For a complete list of videos, visit our video library