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

Author Question: What is the printout after the following loop terminates?int number = 25;int i;boolean isPrime = ... (Read 96 times)

bobbysung

  • Hero Member
  • *****
  • Posts: 519
What is the printout after the following loop terminates?

int number = 25;
int i;

boolean isPrime = true;
for (i = 2; i < number; i++) {
if (number % i == 0) {
isPrime = false; break;
}
}

System.out.println("i is " + i + " isPrime is " + isPrime);

◦ i is 5 isPrime is true
◦ i is 5 isPrime is false
◦ i is 6 isPrime is false
◦ i is 6 isPrime is true


Related Topics

Need homework help now?

Ask unlimited questions for free

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

Kaytorgator

  • Sr. Member
  • ****
  • Posts: 345
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




bobbysung

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


rachel

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

 

Did you know?

If you use artificial sweeteners, such as cyclamates, your eyes may be more sensitive to light. Other factors that will make your eyes more sensitive to light include use of antibiotics, oral contraceptives, hypertension medications, diuretics, and antidiabetic medications.

Did you know?

Hyperthyroidism leads to an increased rate of metabolism and affects about 1% of women but only 0.1% of men. For most people, this increased metabolic rate causes the thyroid gland to become enlarged (known as a goiter).

Did you know?

Most women experience menopause in their 50s. However, in 1994, an Italian woman gave birth to a baby boy when she was 61 years old.

Did you know?

A cataract is a clouding of the eyes' natural lens. As we age, some clouding of the lens may occur. The first sign of a cataract is usually blurry vision. Although glasses and other visual aids may at first help a person with cataracts, surgery may become inevitable. Cataract surgery is very successful in restoring vision, and it is the most frequently performed surgery in the United States.

Did you know?

In 1835 it was discovered that a disease of silkworms known as muscardine could be transferred from one silkworm to another, and was caused by a fungus.

For a complete list of videos, visit our video library