Suppose the input for number is 9. What is the output from running the following program?
```
#include
using namespace std;
int main()
{
cout << "Enter an integer: ";
int number;
cin >> number;
int i;
bool isPrime = true;
for (i = 2; i < number && isPrime; i++)
{
if (number % i == 0)
{
isPrime = false;
}
}
cout << "i is " << i << endl;
if (isPrime)
cout << number << " is prime" << endl;
else
cout << number << " is not prime" << endl;
return 0;
}
```
A. i is 3 followed by 9 is not prime
B. i is 3 followed by 9 is prime
C. i is 4 followed by 9 is prime
D. i is 4 followed by 9 is not prime
D. i is 4 followed by 9 is not prime
You might also like to view...
The map collection has a ‘get’ operation. Why doesn’t the set collection have a ‘get’ operation?
What will be an ideal response?
Which of these is NOT part of the DVD video specification?
a. 720 pixels per horizontal line. b. Multiple audio tracks. c. Multiple text tracks. d. Set-top gaming support. e. Dolby AC-3 Digital Surround Sound.
What type of forensic investigation typically has the highest evidentiary standards?
A. Administrative B. Criminal C. Civil D. Industry
The four layers of the learning continuum as summarized by NIST SP 800-16 are: security awareness, security basics and literacy, roles and responsibilities relative to IT systems, and the _________ level.
Fill in the blank(s) with the appropriate word(s).