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, 22.06.2019 02:00
What graph represents an even function
Answers: 1
question
Mathematics, 22.06.2019 02:00
Gables properties corp. is leasing office building with an area of 49b^2+70b+25. what is the shape of the building? a) rectangle b) square
Answers: 3
question
Mathematics, 22.06.2019 02:40
Ineed the answers for this one as well!
Answers: 1
question
Mathematics, 22.06.2019 03:00
The formula for finding volume of a cone 1/3pi x r^2h. the volume of a cone is 300 cm^3 and the height of the cone is 10 what is the approximate radius of the cone
Answers: 1
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
Social Studies, 23.01.2020 04:31
question
Geography, 23.01.2020 04:31