Question: Suppose the input for number is 9 . What is the output from running the following program? import java.util.Scanner; public class Test { public static
Suppose the input for number is What is the output from running the following program?
import java.util.Scanner;
public class Test
public static void mainString args
Scanner input new ScannerSystemin;
System.out.printEnter an integer: ;
int number input.nextInt;
int i;
boolean isPrime true;
for i ; i number && isPrime; i
if number i
isPrime false;
System.out.printlni is i;
if isPrime
System.out.printlnnumber is prime";
else
System.out.printlnnumber is not prime";
i is followed by is prime
i is followed by is prime
i is followed by is not prime
i is followed by is not prime
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
