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 36 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
Gracias!


Perkypinki

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

 

Did you know?

It is difficult to obtain enough calcium without consuming milk or other dairy foods.

Did you know?

Signs of depression include feeling sad most of the time for 2 weeks or longer; loss of interest in things normally enjoyed; lack of energy; sleep and appetite disturbances; weight changes; feelings of hopelessness, helplessness, or worthlessness; an inability to make decisions; and thoughts of death and suicide.

Did you know?

The first documented use of surgical anesthesia in the United States was in Connecticut in 1844.

Did you know?

Prostaglandins were first isolated from human semen in Sweden in the 1930s. They were so named because the researcher thought that they came from the prostate gland. In fact, prostaglandins exist and are synthesized in almost every cell of the body.

Did you know?

Approximately 25% of all reported medication errors result from some kind of name confusion.

For a complete list of videos, visit our video library