![alejandro8212003](/avatars/42299.jpg)
alejandro8212003
19.02.2020 •
Computers and Technology
What is the output after the following loop terminates?A int number = 25 int i ; B. boolean isprime = true; C. for( i=2; i< number && isprime; i++){ if ( number % i == 0){ isprime = false; }} D. system.out.println("i is " + i + " isprime is" + isprime) ;
Solved
Show answers
More tips
- D Dating, Love, Relationships How Long Can Love Last?...
- S Science and Technology How to Make a Homemade Smoker: The Ultimate Guide...
- S Society and Politics 10 Tips for Boosting Your Self-Esteem...
- C Computers and Internet How to Create a Folder on Your iPhone?...
- G Goods and services How to sew a ribbon: Tips for beginners...
- F Food and Cooking How to Make Mayonnaise at Home? Secrets of Homemade Mayonnaise...
- C Computers and Internet Which Phone is Best for Internet Surfing?...
- F Food and Cooking Everything You Need to Know About Pasta...
- C Computers and Internet How to Choose a Monitor?...
- H Horoscopes, Magic, Divination Where Did Tarot Cards Come From?...
Answers on questions: Computers and Technology
- C Computers and Technology Is there any way to delete old questions on this? if there is no way, take this as a free question...
- C Computers and Technology Iam programming and i want to find the amount of move functions i need to complete the full square. the square is 65 by 70 circles. if each move function is about 18 circles, how...
- A Arts Consideras que algunos de las decisiones tomadas por las autoridades en el contesto actual pueden afectar los derechos humanos? Aunque pudieran afectar los derechos de las personas,...
- H History What impact did the development of horticulture (farming) have on pre-European American Indians? A) It allowed them to grow their own food so that they did not have to be nomadic....
- H History Helllppp Which of the following is a contribution made by units of the US Colored troops? Helped to create new rules for soldier conduct O Proved that they served best in integrated...
- P Physics An engine flywheel initially rotates counterclockwise at 6.39 rotations/s. Then, during 21.7 s, its rotation rate changes to 2.93 rotations/s clockwise. Find the flywheel s average...
- H History What happens to Queen Gertrude at the end of the play...
- M Mathematics Juanita ran a race 1/5 faster than her sister. Her sister ran the race in 68 seconds. How many second did it take Juanita to complete the race?...
- M Mathematics What will you get if you cut a triangle perpendiculary...
- P Physics A wheel having an inertia moment I=10²kgm² starts at rest and reaches an angular velocity of 10rad/s under the action of constant torque M=15Nm. After how long the wheel reaches...
Ответ:
The output of the given program as follows:
Output:
i is 6 isprime is false
Explanation:
In the given program code there is some typing mistake so the correct program to this question as follows:
Program:
public class check //defining class check
{
public static void main(String[] args) //defining main method
{
int number = 25,i,j; //defining integer variable
boolean isprime = true; //defining boolean variable
for( i=2; i< number && isprime; i++) //defining loop count numbers
{
if ( number % i == 0) //if block for check condition
{
isprime = false; //assing value flase in isprime variable
}
}
System.out.println("i is " + i + " isprime is " + isprime); //print value
}
}
Description of the above code as follows:
In the above java code, a class "checks" are defined, inside this class main method is declared, in the main function 2 integer variable "number and i" is defined, in which number holds a value that is "25" and variable "i" is used in the for loop.
In the next step for loop is defined, that starts from 2 and end when i is less then number and boolean variable, inside the loop if block is used, that check number modules value is equal to 0. If this condition is true in the isprime variable assign a false value, and outside the loop, the print function is used that print isprime variable value.Ответ:
d and b can't see the last ones answer so im guessing this is what you needed.
Explanation: