If the user enters a negative number, the number must be not accepted (not counted) and the user must have the chance to re-enter the number again.
The program must successfully calculate and display the following:
The number of integers between 150 and 500.
The number of integer above 500.
The number of primes.
The maximum prime number entered.
The maximum number among all integers.
These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.#include<iostream>
using namespace std;
bool isPrime(int n)
// Corner case
if (n <= 1)
// Check from 2 to n-1
for (int i = 2; i < n; i++)
if (n % i == 0)
By purchasing this solution you'll be able to access the following files: