subject
Mathematics, 02.03.2020 22:52 leannehounschell

The code snippet below checks whether a given number is a prime number. What will be the result of executing it? public static void main(String[] args) { int j = 2; int result = 0; int number = 0; Scanner reader = new Scanner(System. in); System. out. println("Please enter a number: "); number = reader. nextInt(); while (j <= number / 2) { if (number % j == 0) { result = 1; } j++; } if (result == 1) { System. out. println("Number: " + number + " is Not Prime."); } else { System. out. println("Number: " + number + " is Prime. "); } }

ansver
Answers: 1

Another question on Mathematics

question
Mathematics, 21.06.2019 16:20
Find the slope of the line that contains the following points. r(-2, 4), s(6, -2)
Answers: 1
question
Mathematics, 21.06.2019 16:50
Before simplifying, how many terms are there in the expression 2x - 5y + 3 + x?
Answers: 1
question
Mathematics, 21.06.2019 17:00
If i have a 24 in loaf of bread and i cut it into two pieces one 9 in how long was the other
Answers: 2
question
Mathematics, 21.06.2019 17:00
The area of a rectangle is 54x^9y^8 square yards.if the length of the rectangle is 6x^3y^4 yards,which expression represents the width of the rectangle in yards
Answers: 2
You know the right answer?
The code snippet below checks whether a given number is a prime number. What will be the result of e...
Questions
question
Biology, 11.07.2019 06:30
Questions on the website: 13722360