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 103 times)

tiffannnnyyyyyy

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

int number = 25;
int i;

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

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

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


Related Topics

Need homework help now?

Ask unlimited questions for free

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

Viet Thy

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




tiffannnnyyyyyy

  • Member
  • Posts: 512
Reply 2 on: May 6, 2020
:D TYSM


Viet Thy

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

 

Did you know?

When blood is deoxygenated and flowing back to the heart through the veins, it is dark reddish-blue in color. Blood in the arteries that is oxygenated and flowing out to the body is bright red. Whereas arterial blood comes out in spurts, venous blood flows.

Did you know?

Common abbreviations that cause medication errors include U (unit), mg (milligram), QD (every day), SC (subcutaneous), TIW (three times per week), D/C (discharge or discontinue), HS (at bedtime or "hours of sleep"), cc (cubic centimeters), and AU (each ear).

Did you know?

There are 20 feet of blood vessels in each square inch of human skin.

Did you know?

Lower drug doses for elderly patients should be used first, with titrations of the dose as tolerated to prevent unwanted drug-related pharmacodynamic effects.

Did you know?

Hip fractures are the most serious consequences of osteoporosis. The incidence of hip fractures increases with each decade among patients in their 60s to patients in their 90s for both women and men of all populations. Men and women older than 80 years of age show the highest incidence of hip fractures.

For a complete list of videos, visit our video library