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 105 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
Great answer, keep it coming :)


alvinum

  • Member
  • Posts: 317
Reply 3 on: Yesterday
:D TYSM

 

Did you know?

There are more bacteria in your mouth than there are people in the world.

Did you know?

A seasonal flu vaccine is the best way to reduce the chances you will get seasonal influenza and spread it to others.

Did you know?

More than 4.4billion prescriptions were dispensed within the United States in 2016.

Did you know?

If you could remove all of your skin, it would weigh up to 5 pounds.

Did you know?

Over time, chronic hepatitis B virus and hepatitis C virus infections can progress to advanced liver disease, liver failure, and hepatocellular carcinoma. Unlike other forms, more than 80% of hepatitis C infections become chronic and lead to liver disease. When combined with hepatitis B, hepatitis C now accounts for 75% percent of all cases of liver disease around the world. Liver failure caused by hepatitis C is now leading cause of liver transplants in the United States.

For a complete list of videos, visit our video library