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


flexer1n1

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

 

Did you know?

Addicts to opiates often avoid treatment because they are afraid of withdrawal. Though unpleasant, with proper management, withdrawal is rarely fatal and passes relatively quickly.

Did you know?

Vaccines prevent between 2.5 and 4 million deaths every year.

Did you know?

The tallest man ever known was Robert Wadlow, an American, who reached the height of 8 feet 11 inches. He died at age 26 years from an infection caused by the immense weight of his body (491 pounds) and the stress on his leg bones and muscles.

Did you know?

Methicillin-resistant Staphylococcus aureus or MRSA was discovered in 1961 in the United Kingdom. It if often referred to as a superbug. MRSA infections cause more deaths in the United States every year than AIDS.

Methicilli ...
Did you know?

Pink eye is a term that refers to conjunctivitis, which is inflammation of the thin, clear membrane (conjunctiva) over the white part of the eye (sclera). It may be triggered by a virus, bacteria, or foreign body in the eye. Antibiotic eye drops alleviate bacterial conjunctivitis, and antihistamine allergy pills or eye drops help control allergic conjunctivitis symptoms.

For a complete list of videos, visit our video library